← All articles
AI security

How to test AI agent tool permissions and approval boundaries

Build a synthetic authorization matrix for agent tools, verify exact-action approvals and inspect state changes beyond the model’s reply.

3 min read

Test the operation, not the assistant’s confidence

An assistant saying an action is permitted is not the same as the destination authorizing it. OWASP’s Excessive Agency guidance discusses unnecessary functionality, excessive permissions and excessive autonomy, including the need to enforce authorization outside the model. Turn that broad principle into a concrete test matrix. List each operation separately: search, read, draft, send, modify, export and delete. Identify the caller, resource owner and permitted outcome. The examples below describe an original controlled exercise with synthetic resources. They are not instructions to test a third-party system or claims about a vulnerability in a named product.

Create identities and resources with visible differences

Set up three invented personas: a viewer, an analyst and an administrator. Create documents for two separate customer workspaces, using distinct markers in their contents. Give the viewer read access to workspace A, the analyst an additional ability to create drafts there, and the administrator only the management capabilities the test specification actually requires. Do not silently give the administrator unrestricted access to every customer’s content. Write expected decisions for each operation and target pair. The key is to make an inappropriate result unmistakable while ensuring all evidence belongs to the test environment.

Exercise positive and negative cases together

Verify that the viewer can read an allowed document before checking that a different workspace is denied. Verify that the analyst can create an authorized draft but cannot send it when the role does not permit sending. Check expired sessions, removed membership and a resource whose owner changed after a search result was produced. Repeat the boundary tests through the underlying tool interface, not only through a carefully phrased chat request. A refusal in natural language should not substitute for inspecting the destination’s decision and final state. Conversely, a model’s attempted action may be safely blocked by a correctly implemented boundary.

Bind an approval to the action that was reviewed

For operations requiring approval in your policy, show the reviewer the target, operation and consequential fields. Exercise what happens if a draft recipient, destination, amount or attachment changes after that preview. The system should apply the declared approval policy to the actual operation being executed, with stale or mismatched approval handled explicitly. Also test cancellation, expiry and replay with invented fixtures. Record which operation was approved and which operation reached the destination. A generic earlier agreement to help with a task should not silently satisfy a narrower approval rule that your application requires for its final action.

Check retries and failure recovery

Create a controlled failure after a request has been accepted but before the client receives confirmation. Observe whether a retry duplicates the action, reuses an obsolete approval or produces an auditable recovery decision. Use a disposable destination where the consequences can be inspected safely. Capture correlation identifiers, authorization results and final resource state without copying sensitive tool arguments into broad logs. An exercise that ends at a successful HTTP response may miss a duplicate write or a partially completed workflow. Define the expected state transitions before the test and distinguish a transport failure from a rejected operation.

Produce a release decision from evidence

Summarize allowed operations, verified denials, approval checks, retry behavior and unresolved gaps. Associate each failure with the component that must enforce the rule: identity, resource authorization, tool implementation or approval workflow. Preserve benign cases alongside adversarial ones so a repair does not break intended use. The release owner should be able to identify exactly which prohibited state change was attempted and whether it occurred. Keep the matrix versioned as tools and permissions evolve. The result is a reproducible permission review rather than an informal demonstration that the assistant sounded cautious during one conversation.