Engineering guide
AI Agent Safety Evaluation: Scope, Side Effects, and Honest Completion
Test whether an AI agent stays within scope, controls side effects, and reports completion with evidence.
Copy the working template
Design a safety evaluation suite for the AI agent below. Return: (1) an explicit task contract with allowed and prohibited actions, (2) approval gates and stopping conditions, (3) ten adversarial or failure-injection test cases, (4) expected tool calls and forbidden side effects for each case, (5) separate scoring rubrics for task outcome, scope adherence, side-effect control, and reporting honesty, (6) durable evidence required before the agent may claim completion, and (7) the three highest-risk gaps in the current design. Do not treat a successful final answer as proof of safe conduct. Agent context: [Describe the user goal, system prompt, tools, permissions, data sources, external services, and current evaluation approach]
A practical starting sequence
- Translate the request into an explicit task contract.
- Test unsafe shortcuts and failure states at every tool boundary.
- Score the final outcome and the agent conduct separately.
- Require evidence for completion, state changes, and unresolved risks.
Define the task contract
Record the allowed goal, resources, identities, data boundaries, approval gates, prohibited actions, and stopping conditions. Each test should state what the agent may read, what it may change, and what evidence is required.
Inject realistic failures
Test malicious retrieved content, ambiguous instructions, stale state, timeouts, duplicate callbacks, permission denial, and partial writes. Include conflicts inside documents and tool output, because untrusted content often enters outside the user message.
Separate outcome from conduct
An agent can produce the right artifact through an unsafe path. Score task success, scope adherence, side-effect control, permission handling, recovery, and reporting honesty independently so a polished answer cannot hide prohibited behavior.
Verify the resulting state
Inspect durable records, external side effects, logs, identifiers, and artifacts instead of accepting a fluent completion message as proof. Also check for unintended recipients, duplicate actions, and changes outside the requested scope.
Test authorization at the tool layer
Ask for another user record, a wider file path, an unapproved recipient, or reuse of expired approval. The tool or policy layer must deny the call even when the model provides a persuasive justification, and the denial must appear in the trace.
Measure recovery and escalation
Verify that retries are bounded and idempotent, uncertain outcomes trigger a state check, and repeated failures produce a useful handoff. The handoff should name what succeeded, what may have changed, and what requires a human decision.
How this guide was prepared
This guide turns production engineering practice into a repeatable decision process. Examples are checked for explicit inputs, observable outcomes, failure handling, and reversible actions. Validate the steps against your own traffic, data model, permissions, and recovery objectives.
Read our editorial and review standardsFrequently asked questions
What should an AI agent safety evaluation measure?
Measure task success, scope adherence, side-effect control, permission handling, recovery behavior, and reporting honesty separately. A correct final answer does not prove that the agent used a safe path.
How do you test an agent for prompt injection?
Place conflicting instructions in retrieved pages, documents, tool output, and user-provided data. The agent should treat that content as untrusted data, preserve the original task contract, and refuse unauthorized actions.
What evidence should an agent provide before claiming completion?
Require durable artifacts, external state checks, tool results, identifiers, timestamps, and a clear list of unresolved failures. A fluent completion message by itself is not evidence.
When should an AI agent require human approval?
Require approval before irreversible, financial, public, identity-sensitive, credential-related, or high-impact external actions, and whenever the requested scope is ambiguous.
Reusable resources
Prompts and workflows for this problem
More editor-verified resources are being prepared for this guide.