Grant only the permissions the task requires
Baseline Layer 04 · 06Allow the model to use only what the current task requires, rather than everything the product might conceivably need.
Most agent frameworks issue a single credential with broad permissions, because that is what makes a demonstration work. It also means that one successful attack inherits every permission you hold.
The remedy is unglamorous and effective: bind each permission to the step that needs it.
- Credentials for one task only. A run that summarises tickets receives read access to tickets. Not write access, and not access to tickets belonging to other customers.
- A tool list for each step. The tools offered to the model change as the work progresses, rather than remaining constant for the whole session.
- No permanent credentials in the prompt. Credentials belong in the code that performs the work, never in text where they can be talked out.
- Separate reading from writing. The step that reads retrieved content should not be the step holding the ability to write.
How to apply it
Where it goes: the code that calls your tools, not the prompt. In the reference system that is the function behind send_email() and whatever issues the credential it runs under.
-
Write down what the task genuinely needs
For a ticket summariser, that is read access to tickets belonging to the customer who asked. Not write access, not other customers, and not the mailbox.
-
Issue the credential for that run only
Ask your identity provider for a short-lived token scoped to the task, rather than passing the long-lived service account the application starts with.
# wrong: one credential for everything the product might ever do client = Tickets(token=SERVICE_ACCOUNT) # right: a token minted for this run, for this customer, read only token = mint_token(scope="tickets:read", customer=caller.customer_id, ttl=300) client = Tickets(token=token) -
Change the tool list as the work progresses
The step that reads a ticket does not need the email tool. Offer the model only the tools the current step requires, rather than the full set for the whole session.
TOOLS = { "summarise": [read_ticket], # no way to send anything "reply": [read_ticket, send_email], # only after a person approves } tools = TOOLS[step] -
Check what happens when it is refused
Point the run at a ticket belonging to a different customer and confirm the store refuses it. If the refusal only comes from your own code, the control is in the wrong place.
Excessive agency (LLM03). A total compromise becomes a limited one, because the attacker receives exactly the permissions of the step they reached and nothing beyond it.
The attack itself, and anything within the permissions you did grant. If a step can legitimately read a document, an attacker who reaches that step can read it too.
Genuine engineering in the orchestration code, together with continual pressure to widen permissions for convenience. Gradual widening is how this control decays.