keepcalculator

06 Numbers and Powers

How to Evaluate Whether an AI Agent Is Safe for Tools

Card No. 06·36286 · Updated · Standard formula, shown below

Giving an AI agent access to tools lets it do more than generate text: it may read files, send messages, run code, or change records. Use the steps below to assess its behavior before granting access, then limit and monitor the permissions it receives. Start in a test environment with non-sensitive data; do not use real accounts or irreversible actions for initial trials.

What You’ll Need

  • A written list of the tasks the agent should and should not perform.
  • A test environment or sandbox, sample data, and separate test credentials.
  • A description of each tool’s permissions and possible side effects.
  • Logs or another way to review the agent’s prompts, tool calls, results, and errors.
  • A person authorized to approve access and respond to incidents.

Step-by-Step

  1. Define the intended job and boundaries. Write down the expected inputs, permitted actions, and acceptable results. Be specific: “draft a reply for review” is safer and clearer than “handle customer email.” Name prohibited actions too, such as sending messages without approval, deleting records, or accessing unrelated files. Decide what counts as a failure and who can stop a run.
  2. Inventory the tools and their effects. For every connected tool, identify what information it can read, what it can change, and whether its actions are reversible. Check whether it can access an entire workspace when the task needs only one folder. Treat browsing, code execution, email, databases, shell commands, and file access as distinct capabilities, not as a single vague permission.
  3. Reduce permissions before testing. Use a dedicated account with the narrowest access that supports the task. Prefer read-only access for analysis, restricted folders for file work, and test endpoints for changes. Remove unrelated tools and credentials. Avoid placing passwords, tokens, private keys, or sensitive personal data in prompts, test files, or logs.
  4. Build a contained test. Use synthetic or suitably anonymized examples and keep the agent away from production systems. Block outbound network access unless it is necessary and controlled. Set limits on run time, tool-call count, data volume, and spending where those controls exist. Confirm that the sandbox really prevents access to host files and other accounts; do not assume the word “sandbox” guarantees isolation.
  5. Test ordinary tasks first. Run representative requests, including incomplete or ambiguous inputs. Check whether the agent asks for clarification, stays within scope, uses only approved tools, and produces verifiable results. Compare outputs with a known answer or have a qualified reviewer inspect them. A plausible explanation is not proof that a tool call succeeded correctly.
  6. Test misuse and hostile inputs. Try requests that ask it to exceed its role, reveal secrets, alter unrelated data, or act on instructions embedded in a document or web page. Include malformed inputs and conflicting directions. Look for whether it treats untrusted content as data rather than authority, refuses disallowed actions, and avoids passing sensitive content to tools. Do not use real secrets in these tests.
  7. Check approval gates and failure behavior. Verify that consequential actions—such as sending, deleting, publishing, or changing access—require a human confirmation when appropriate. Test what happens if a tool times out, returns an error, or gives unexpected data. The agent should not silently claim success, repeat a potentially consequential action without checking, or continue after losing control of a required safety check.
  8. Review the evidence. Inspect the full trace: request, relevant context, tool selected, arguments, returned data, and final response. Check for unnecessary data access, unexpected destinations, repeated calls, and mismatches between the result and the tool output. Record issues and repeat failed scenarios after changes. Keep logs access-controlled and avoid retaining sensitive content longer than needed.
  9. Roll out gradually and monitor. If testing is satisfactory, start with a small group or low-impact task, limited permissions, and human review of consequential outputs. Set a clear owner, a way to revoke credentials quickly, and alerts or periodic reviews for unusual activity. Expand access only when the task requires it and observed results support the change. Reassess after changing the agent, its instructions, tools, or connected data.

Common Mistakes

  • Testing only easy prompts: Routine success does not show how the agent handles ambiguity, malicious content, or tool errors.
  • Granting broad access for convenience: A tool that can read or change everything increases the impact of mistakes. Scope access to the task and account.
  • Confusing a refusal with a control: Instructions to “be careful” do not replace technical restrictions, approval gates, and revocable credentials.
  • Trusting the final answer alone: Review tool calls and returned data; an accurate-sounding summary can conceal an incorrect or unauthorized action.
  • Moving tests straight to production: A successful sandbox run is useful evidence, not a guarantee. Production data, permissions, and integrations can behave differently.
  • Ignoring logs and ownership: Without an operator who can inspect activity and disable access, problems can go unnoticed or persist.

Tips

  • Use separate credentials for each agent and environment. Make them easy to revoke and avoid sharing human accounts.
  • Prefer tool designs that separate reading from writing and require confirmation for high-impact actions.
  • Make the allowed scope explicit in both the agent instructions and the technical permissions; rely on the technical boundary when they disagree.
  • Test with realistic but non-sensitive examples, including edge cases, and keep a record of expected behavior and results.
  • Define a stop condition: for example, halt and ask a person when the request is unclear, the tool output is unexpected, or a required check fails.

Troubleshooting

  • The agent uses the wrong tool: Remove unnecessary tools, narrow the task instructions, and test whether the tool descriptions or overlapping capabilities are confusing. Review the call trace before trying again.
  • It claims an action succeeded, but nothing changed: Compare its claim with the tool response and system record. Treat a missing or ambiguous confirmation as failure; do not repeat the action until you know whether it may already have happened.
  • It accesses information outside the test: Stop the run, revoke or disable the credential, and preserve relevant logs securely. Check the permission scope and sandbox boundary before resuming with synthetic data.
  • It obeys instructions found in a file or page: Treat that as a test failure. Limit the agent’s access to untrusted content, clarify that such content is not authorization, and add technical checks so content cannot trigger privileged actions by itself.
  • Tests pass inconsistently: Repeat the same scenarios and compare traces, not just final answers. Reduce unnecessary context and tools, make approval conditions explicit, and keep human review until results are reliable enough for the intended risk.

Frequently Asked Questions

Can I rely on the agent’s own safety statement?
No. Treat claims as unverified. Check actual permissions, tool calls, outputs, and logs.

Should an agent ever have write access?
Only when the task needs it. Restrict the account and destination, test changes outside production first, and require human approval for consequential actions.

Is a sandbox enough to make testing safe?
Not by itself. Verify isolation, restrict credentials and network access, and use non-sensitive data. A misconfigured sandbox can expose other systems.

What should I test before connecting a real account?
Test routine tasks, ambiguous requests, hostile instructions in supplied content, permission boundaries, tool failures, and approval flows with fake data and credentials.

How often should I reassess tool access?
Review it periodically and whenever the agent, instructions, tools, connected data, or task scope changes. Remove access that is no longer needed.

What if the agent makes an unexpected change?
Stop further runs, revoke the relevant access, check logs and affected systems, and follow your organization’s incident process. Resume only after the cause and safeguards are addressed.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →