| Guardrail | A rule that constrains inputs, tool calls or outputs before they take effect. |
| Approval gate | A step where a person must confirm a high-impact action. |
| Least privilege | Granting an agent only the tools and data it needs for its task. |
- Agents can write to external systems.
- Mistakes are expensive or hard to reverse.
- Regulated or audited environments.
- 01Classify tools by impact: read, write, irreversible.
- 02Validate tool arguments against a strict schema before execution.
- 03Require approval for write or irreversible actions.
- 04Log the decision, approver and outcome for replay.
Order agent with a read/write split
- Context
- An assistant can look up orders and cancel them.
- Problem
- Giving every action the same permission level risks unauthorized cancellations.
- Approach
- Allow lookups automatically and require approval for cancellation; deny everything else by default.
- Outcome
- Useful automation with a hard boundary around writes.
Refund above the approval limit
- Context
- An agent receives a refund request for a large amount.
- Problem
- The request is valid in shape but exceeds the agent's spending authority.
- Approach
- Validate amount and caller scopes server-side before calling the payment service.
- Outcome
- The request is rejected or escalated instead of being paid out.
Tool risk tiers for an order agent
read:
lookup_order: auto
write:
cancel_order: approval_required
irreversible:
issue_refund: approval_required + dual_control
default: denyDeny by default and only gate high-impact tools — gating every read creates approval fatigue.
Server-side validation before a refund
def issue_refund(args, caller):
if not ORDER_ID.match(args["order_id"]): raise Invalid()
if args["amount"] > 5000 and "finance" not in caller.scopes: raise Forbidden()
return payments.refund(idempotency_key=args["key"], **args)Validate schema, limits and scopes in code. A prompt instruction is not a security boundary.
Strict approvals
Up: Strong control and audit
Down: Slower, higher human workload
Automatic execution
Up: Fast and scalable
Down: Requires excellent validation and rollback
Output filters
Up: Catch unsafe content
Down: False positives can block valid work
| Option | Upside | Cost |
|---|---|---|
| Strict approvals | Strong control and audit | Slower, higher human workload |
| Automatic execution | Fast and scalable | Requires excellent validation and rollback |
| Output filters | Catch unsafe content | False positives can block valid work |
- Deny by default; allow tools explicitly per agent.
- Validate arguments server-side, not only in the prompt.
- Make approval requests show the exact action and payload.
- Log every override and failed validation.
| Key | Typical value | Note |
|---|---|---|
| approval_required_for | write actions | Explicit tool list. |
| validation | strict schema | Reject unknown fields. |
| audit_retention | policy-driven | Keep records for replay. |
| Symptom | Cause | Fix |
|---|---|---|
| Agent exceeds its scope | Broad tool permissions | Split tools into read/write and scope per role. |
| Approval fatigue | Too many low-risk gates | Only gate irreversible or high-impact actions. |
Where should guardrails live?
In your application and tool layer, not only in the prompt. Prompts can be bypassed; server-side validation cannot.
When is full autonomy acceptable?
For reversible, low-impact actions with measurable success criteria and automatic rollback.
More in Agents & agentic AI
Agent anatomy: loop, planner, tools and memory
The minimal system behind an AI agent: a goal, a reasoning loop, tool access, state and a stop condition.
Agentic patterns: ReAct, plan-and-execute, reflection
Three reusable reasoning patterns and how to choose between them for real workloads.
Multi-agent orchestration patterns
When to split work across agents, how they hand off, and how to avoid coordination overhead.