Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q47HardSystem design

Design an action-guardrail layer (policy engine) for agents that operate on business systems.

30-second answerSay your answer out loud first, then reveal.
An agent's proposed tool call goes to a policy enforcement point, which logs to an audit log and asks a policy decision point that uses session identity and context; the decision is allow, deny with a reason, require approval, or modify parameters.

Policy examples

text
- refund.create: allow if amount ≤ 2,000 AND order.owner == session.user
                 require_approval if 2,000 < amount ≤ 20,000; deny otherwise
- email.send:    allow if all recipients in company domain; else require_approval
- records.delete: deny for agents (soft-archive only via archive tool)
- any tool:      deny if session.risk_score > threshold; rate-limit 20 calls/min/user

Design considerations

  • Identity from the session, not the model: the agent cannot claim to be another user.
  • Deterministic and testable: unit tests for policies; policy changes go through review.
  • Explainable denials returned to the agent so it can adjust or inform the user.
  • Performance: in-process or sidecar policy evaluation (milliseconds).
  • Defaults: deny by default for new tools until policies are written.

You understood something today that you didn't yesterday.