An Authorization Boundary for AI Agents
I wanted to get a small local authorization broker working: a trusted client, a broker, and a provider adapter, with 1Password as the first credential source. The initial version needed to be simple enough to build and examine. I was considering encrypted delivery, but I did not want that first version to grow a persistent identity system, key recovery, rotation, and a ratchet without a concrete need for them.
The question I keep returning to is what the broker would hand over. If an agent asks to deploy one build, does it need a deployment credential, or does it need a trusted component to submit that build? The distinction affects both the permission I grant and how much code the broker has to contain. Secret delivery is a smaller integration surface. Constraining an operation could give the agent less authority, but it requires the broker to understand more of the service it calls.
For a concrete test of the delivery design, suppose an agent supplies a public key to receive a deployment token. The broker retrieves the token, encrypts it to that key, and returns ciphertext. If the agent chose a key controlled by someone else, the encryption protects delivery to the wrong recipient. This is a hypothetical failure case, but it shows what an encrypted envelope leaves for the surrounding design to establish: whose request is this, and who is allowed to receive the result?
My intended rule for secret delivery is a fresh recipient keypair generated by the trusted client for each request. Its private key would live only in that client’s memory: never in command-line arguments, environment variables, a file, or broker state. The public key could accompany the request. Decryption, timeout, cancellation, and failure would all end the key’s intended lifetime. A cancelled request would not leave a reusable recipient credential behind for the next task.
That arrangement needs more than a separate process. A process boundary can separate memory, but it does not tell the broker whose request it received or whether the supplied key belongs to the intended client. I would still need a defined way to authenticate the local connection and bind its request to approval. If an agent can impersonate that client, replace the public key, or reach an unrestricted alternate endpoint, the ephemeral key has not repaired the authorization problem.
The approval therefore has to identify the operation and its recipient together. For a deployment, I would want a particular project, environment, and build, plus the recipient key and a request identifier. “Deploy the current build” leaves something mutable between approval and execution. An artifact digest gives the broker a value it can check again. The agent’s explanation can help a person understand the request, but the broker needs fields it can compare without asking the model what they mean.
HPKE would be one candidate for the encrypted envelope. It specifies hybrid public-key encryption and ways to bind context into an encrypted exchange. It does not supply the application’s authorization policy or prevent application-level request replay. Putting a request identifier into authenticated data can help bind a message to context; deciding whether that request is permitted remains the broker’s job.
The in-memory rule also needs careful wording. The private key necessarily exists in RAM while the client uses it. Explicit zeroization can shorten the lifetime of a managed buffer, but it is not a claim that no copies ever existed. The Rust zeroize documentation calls out copies caused by moves, stack spills, and buffer reallocations. I would want cleanup on the ordinary success and error paths, while reviewing crashes and operating-system behavior separately. “Ephemeral” should describe a lifecycle we can inspect, not an assurance that memory has become inaccessible under every threat model.
A one-request client can start again after a restart with a new key and a new approval. It does not need to recover an old recipient identity. That is why deferring persistent keys and ratchets is more than cutting features from a schedule: it leaves a lifecycle I can describe from creation to disposal. Adding continuity later would mean answering additional questions about storage and trust, and might change this design substantially.
But even a correctly approved, correctly encrypted delivery leaves the agent holding the token’s authority. If the token permits several projects or destructive operations, the envelope does not narrow those permissions. Deleting the recipient key later does not revoke a credential already decrypted. The service accepting the token will enforce its own rules, not the broker’s earlier description of the task.
That is why I am more interested in a cred run path when the agent does not need the raw secret. Here, I mean a trusted operation that uses the credential and returns a result. The broker might submit one specified build to one specified deployment target. The agent receives the operation’s status and permitted output. The trusted component retains the credential and checks the same request it is about to execute.
The word run can conceal a substantial difference. 1Password’s op run makes secrets available to a subprocess through environment variables. That is a useful way to supply credentials to a program, but the program still receives them. If my proposed broker accepts an arbitrary shell command, then launches it with a broad token, calling the operation trusted has accomplished very little. The command can use whatever authority that token carries.
A constrained version would need known operations and validated parameters. Even then, a deployment tool that executes project-controlled hooks could bring untrusted code inside the credential boundary. I would have to understand the operation, its configuration, and the code it can invoke. This is the serious cost of moving from secret delivery to trusted execution: the broker takes responsibility for enough service behavior to constrain the action. An adapter cannot safely become a universal command runner merely because that would make integration easier.
There is a reasonable case for delivery when the receiving program is already trusted and a narrowly scoped credential is available. Building a service adapter for every workflow could create more privileged code than the small broker was meant to contain. I do not want an absolute rule that forces all work through a growing local control plane. I want the choice to expose its consequence: either the broker controls an operation, or it delegates the permissions represented by the credential.
Failure makes that consequence especially visible. Suppose a trusted deployment request times out after the remote service accepts it. The broker cannot infer from the missing response that nothing happened. Retrying may perform the operation twice unless the service supports a suitable idempotency mechanism. Cleanup still needs to happen, but erasing the recipient key or marking the request finished does not undo a remote action. The result needs to distinguish failure to act from uncertainty about an action already submitted.
Those are the paths I would want to examine in the first implementation: a changed target, a substituted recipient, an expired approval, cancellation before delivery, and a response lost after execution. They give “small” a more useful meaning for this project. I can defer long-lived keys and recovery; I cannot defer deciding what a successful request authorizes. At the end of it, I need to be able to say whether the agent received a result or a credential it can continue using, and why that was the right choice for this operation.
Labels