An agent that can edit a workspace, call a CRM, or publish a page often runs with one broad service credential for its whole session. That is convenient until the task changes shape. A prompt-injected document, a confused target, or a retry loop can turn a permission intended for one approved update into access to every update the credential allows.
The practical move is to issue a capability lease only after the task is understood and, when needed, approved. A lease is a short-lived authorization object bound to one task, named target, allowed operation, and narrow constraints. The executor validates the lease at the action boundary; the model does not interpret the lease as permission to explore. When it expires or the operation reaches a terminal result, it no longer authorizes anything.
AWS’s guidance for agentic systems recommends temporary credentials, dynamic permission boundaries, and just-in-time access to limit elevated permissions to the duration of the operation that needs them.[1] It separates broad service limits from per-operation transaction constraints such as session policies, tags, and contextual conditions.[1] AWS IAM likewise notes that temporary credentials can be configured for a limited lifetime and cannot be reused after expiration.[2] The general pattern works even when you do not use AWS: issue less authority, later, for less time.
Treat approval and access as different objects
A proposal says what the agent wants to do: change this record, send this message, or deploy these files. An approval says a reviewer or policy accepted that proposal. A lease is the executable authorization created from that approval. Keeping those objects separate prevents a common shortcut: treating a chat message that says “approved” as a reusable credential.
For example, an approved request to update one customer’s renewal date should not give an agent unrestricted customers:update permission. The executor can issue a lease that permits only update_customer, only customer_id=cus_1842, only renewal_date, only the exact approved value, and only until a stated expiry. The agent may submit that request once; any change of target, field, or value requires a new proposal and lease.
This complements—not replaces—technical sandboxing. OpenAI’s Codex guidance distinguishes sandbox mode, which constrains what an agent can technically touch, from approval policy, which controls when it must stop for review.[3] A capability lease adds an application-level check at the specific business operation, where the service can reject a technically possible but unauthorized action.
Copy this capability-lease contract
Put this between proposal approval and any tool that can create, update, send, publish, spend, or change permissions.
1. CREATE A PROPOSAL
proposal_id: [stable ID]
target: [one stable resource ID]
operation: [one allowlisted verb]
patch_or_payload_digest: [exact approved effect]
evidence_and_version: [sources and current-state witness]
2. APPROVE OR REJECT
approval_id: [stable ID]
decision: approved | rejected
approved_by: [policy or reviewer identity]
approved_at: [timestamp]
3. ISSUE A CAPABILITY LEASE ONLY FOR APPROVAL
lease_id: [opaque, server-issued ID]
binds_to: {proposal_id, approval_id, target, operation, payload_digest}
constraints:
- allowed_fields: [explicit allowlist]
- resource_scope: [one record, project, or path]
- max_uses: 1
- not_before: [timestamp]
- expires_at: [short timestamp]
- required_state_version: [current version, if applicable]
status: active | consumed | expired | revoked
4. ENFORCE AT THE EXECUTOR
- Resolve lease_id server-side; do not trust model-supplied claims.
- Require exact matches for target, operation, and payload digest.
- Check expiry, use count, approval, authorization, and state version.
- Atomically mark the lease consumed with the action receipt.
- Return conflict, expired, or forbidden—not a broader permission.
5. ON CHANGE OR RETRY
- Changed target, fields, or payload: create a new proposal and lease.
- Same uncertain write: look up its operation result before retrying.
- Finished, rejected, or timed-out work: expire or revoke the lease.
The lease should be opaque to the model. A signed token can be useful between services, but the tool layer should still verify its issuer, audience, expiry, and binding claims; a model should never be able to edit a JSON-looking lease into broader authority. A server-side lease record is often easier to audit and revoke because the executor can check its current status before acting.
Make the lease narrower than the role
Your service identity may legitimately need a broader ceiling so it can handle several workflow types. Do not hand that ceiling directly to each model turn. AWS describes this layering explicitly: broad capability limits belong on the service identity, while per-operation constraints belong on the transaction identity.[1] Translate that idea into your own API: the service may be capable of updating customer records, but a particular lease permits one approved field change on one record.
Add environmental constraints when they matter. A production publish lease can bind to a named repository, branch, artifact digest, and deployment environment. A data export lease can bind to one tenant, approved columns, a row limit, and a destination controlled by the application. A support-send lease can bind to exact recipients and a draft digest. Every condition should be checked by code at execution, not merely written into the prompt.
Failure mode: a lease that becomes a long-lived master key
A lease loses its value if it is broad, reusable, or silently renewable. A two-hour token that permits every action in a production account is only a standing key with a timer. AWS warns against broad roles, long-lived static credentials, and reactive permission grants that are never revoked.[1]
Start with one-use leases for consequential writes and short expiries matched to the real approval window. Log the proposal ID, lease ID, checked constraints, action receipt, and terminal status. Do not renew a lease because an agent says it is still working; require a fresh policy decision or approval when the original deadline passes. If a task needs several distinct effects, issue separate leases or a deliberately reviewed batch authorization—not one vague permission that grows with the conversation.
The habit to keep
let an agent reason with broad context, but let it change the world only with a short, named authorization that exactly fits the approved action.