Fileaify agent API — Access — Requesting access
Part of the Fileaify agent protocol. Start page and index: /agent. Everything in one document: /agent/full.
Request additional access
Pairing never grants a secret. Capabilities are separate: project.read, documents.write, resources.read, secrets.use and secrets.export. Secret export requires an explicit binding grant; resource visibility alone cannot reveal it.
Secret export is off by default. It works only when the owner enabled it in the account, in the workspace settings and in the project; otherwise any secrets.export request or reveal returns 403 secret_export_disabled. Do not retry: tell the user which option to enable. Prefer secrets.use (broker or executor env), which avoids returning the value in the API response. Code receiving an injected secret can read or transmit it; grant this use only to trusted code. Keys are personal (usable only by their owner and the agents that owner sponsors) or team keys (administered by the workspace); read_references shows ownership and owner_id. Never request a personal key of someone other than your sponsor: the request cannot be granted. If you must hold a value, keep it out of your conversation: write a small local routine that calls the reveal endpoint with your token, stores the answer in a private file and lets your procedures read that file without printing it.
POST /api/v1/projects/{project_id}/access-requests accepts:
{"capability":"resources.read","reason":"Why this task needs service references"}
For secret export, use capability:"secrets.export" and the specific binding_id. Permissions have no use counter and you do not propose a duration: the human who accepts chooses it (1 hour, 5 hours, 1 day or 1 week; 1 hour by default), so ask again after it ends. Any hours or max_uses you send is ignored. The project and binding must belong to the token's organization. Do not guess identifiers to probe inaccessible projects; obtain the authorized project context from the user.
GET /api/v1/access-requests returns your requests. They reach only your sponsor, the member who approved your pairing: nobody else, administrators included, decides them. Your sponsor can only grant what they hold themselves (403 sponsor_lacks_capability otherwise); the server generates the grant's documentary reference and rationale. A document mentioning a right does not create it. Missing or stale access documentation is a warning, never an authorization fallback.
GET /api/v1/projects/{project_id}/resources lists authorized service usages and bindings. Once a specific export grant is active, POST /api/v1/projects/{project_id}/bindings/{binding_id}/reveal with {} returns the authorized value and consumes an allowed use. For an imported file, encoding: "base64", filename and size accompany value; decode it only into private tool storage. ?download=1 on that same POST returns the binary attachment with the same authorization and single-use consumption. Files cannot be used as HTTP authentication headers through the broker. Never log, document or forward that value to an unrelated destination. Do not automatically retry an uncertain secret delivery: an allowed use may already have been consumed. Revoking a grant blocks future delivery but cannot retract a value already exported.
See which keys exist: vault references
GET /api/v1/projects/{project_id}/references (MCP read_references) is readable with project.read. It lists the vault references of the project (vault://brevo/key-sitefait), the service and provider, the kind (secret or file), the usage of the key in this project, its state and the binding_id to quote in an access request. It never returns values, versions or endpoints. Use it to decide which key to ask for, then request secrets.use or secrets.export for that binding_id (see above). GET /readiness returns the same references with can_use and can_export.
Team and personal keys. ownership is team (one common value) or personal (one value per member: each person enters their own, nobody sees anyone else's, administrators included). You are always served the value of your sponsor, the member who paired you, and never anybody else's. has_value says whether your sponsor holds a value for this key: on a personal key it is false until they enter theirs in the project vault, and then can_use and can_export stay false, decisions return 409 key_value_missing and so do uses of the key. Do not retry and never ask for a value in the conversation: tell your sponsor to enter their own value for that reference in the project vault (next_steps.missing_value in /readiness). An administrator may switch a key between team and personal at any time; nothing is overwritten.
Keys usable locally. When a person develops on their own machine and no executor or relay fits, a key may be marked local_use (read it in read_references). With your secrets.use grant on its binding, call POST /api/v1/projects/{project_id}/bindings/{binding_id}/local-link (MCP local_key_link) with optional expires_in (seconds, 300 at most), shell (curl, curl.exe for Windows cmd, powershell), name (writes NAME=value) or format (one line of at most 200 characters with {value} once) and dest (default .env.local). The reply holds a one-use link and a ready command: run it as it is in the person's local shell, so the value goes straight into the file. Never fetch the link with a tool whose output comes back to you, never print, read or quote the file, and do not commit it. Each link consumes one use; one live link per person (a new one replaces an unused one); a used, expired or replaced link answers 410. A key not marked local answers 403 key_not_local.
Keys and machines the vault does not hold yet. GET /api/v1/projects/{project_id}/missing (MCP open_missing_items, needs resources.read) returns the address of one page of the project and how many lines wait on it (keys, ssh); it lists nothing. The page is computed each time it is opened, from the published documents, the references written in proposals awaiting review and the ## Hosts table: it shows each provider key with a link to the provider's key-creation page and a field to store the value, and each documented machine with a ready command that installs a generated public key. Before offering it, write in the project documents the vault://provider/key_name reference of every key you use (provider in lowercase letters, digits and _ only), and name each machine in the ## Hosts table; then give the person the url. The address is the project's page, not a secret: it needs their signed-in session. They type the values there: never ask for one, never write one in a message or a document, and never store one yourself. A key still waiting for the person's confirmation that its public half is installed cannot be used by you: it is not served, and decisions on it answer as for a missing value. Offer the page after you submitted documents that name new keys or machines, whether they were published at once or wait for review (references in a proposal show on the page marked as proposed, not validated).
The detail of services, connections and destinations still requires resources.read. In project documents, write a reference only when it is a real one: every vault://… string is read as a reference and an unlinked one raises an attention point. For the rare illustrative example, put a backslash right before it (\vault://service/key): it is then plain text.
Request a missing project binding
GET /api/v1/projects/{project_id}/readiness reports your effective project capabilities, visible bindings with their purpose, permitted secret operations, pending requests, plan restrictions and document locks. It never reveals secret values or secrets belonging to other projects.
If a required key is not linked, submit POST /api/v1/projects/{project_id}/binding-requests with {"reference":"vault://stripe/my-key","purpose":"Test subscription billing","reason":"Required to implement this project's billing"}. You need project.read. The request goes to your sponsor in the web/PWA inbox. A team key is bound only if your sponsor administers the workspace; a personal key, also if your sponsor holds a value on it. Its response does not confirm whether the key exists elsewhere. If the vault holds no such key, nobody is asked to approve anything: the need is recorded on the project's missing-items page (the response carries its address as missing_items_url), a person enters the key there, and the key is attached with your stated purpose and your request becomes accepted. Until then it reads pending; do not ask the user to create the key by hand. An ambiguous reference must be corrected; the server never guesses.
Approval links the existing service and secret to this project, records the purpose in the access register and returns a binding_id through GET /api/v1/access-requests. It grants no secret use or export. Then request the required capability separately using the access-request API above. Request approval expires after 24 hours; the secret-use request has its own duration and usage count. Never ask the user to paste a secret into the conversation.
Use a credential without requesting its export
An organization administrator can enable HTTPS access on a connection: an exact URL, authentication header/format and allowed methods. This is disabled by default. An explicit secrets.use grant on the binding is separate from secrets.export; request it through the same access-request API with a reason, duration and usage limit.
POST /api/v1/projects/{project_id}/bindings/{binding_id}/request accepts {"method":"GET","body":""}. body is an optional JSON text string (maximum 32,768 characters). The agent cannot change the destination or headers. Fileaify injects the binding's current credential, verifies TLS against the configured hostname and pins a public IPv4 address. Private/special addresses, non-HTTPS destinations and redirects are refused. Only configured methods are allowed. Responses are limited to 64 KiB and returned as {status,body}; obvious credential echoes are redacted. Never treat this redaction as a guarantee that an untrusted provider cannot disclose a credential: administrators must trust the exact destination they configure.
The binding's use is consumed before transmission; failure or an ambiguous response also consumes it. Do not retry automatically, especially writes. The initial instance limits broker calls to 100 per day. This does not offer arbitrary URL fetching or SSH execution. Use an explicit, separately approved export grant if the operational tool requires a local credential.