Skip to main content
Advanced16–24 hours

Governed Operations Agent

Build a governed AI agent with tools, explicit state, approvals, cost and time limits, an audit log, and a rollback path.

agent statetool contractsMCPauthorizationhuman approvalauditability

Scenario

Task

An agent prepares changes to an operating environment: it reads data, creates a plan, invokes tools, and requests approval before risky actions. Every action must be reconstructable from the audit trail.

Step-by-step execution

1. Design the state machine

Outcome: Agent behavior does not depend on a hidden loop.

Tasks

  • Define states
  • Define transitions
  • Add maximum-step limits
  • Add terminal outcomes

Checks

  • Every state has an exit condition
  • An infinite loop is impossible

2. Introduce tool governance

Outcome: Every tool has a contract and explicit access boundaries.

Tasks

  • Define input/output schemas
  • Assign a risk level
  • Set the permission scope
  • Add dry-run support

Checks

  • Unknown tools are blocked
  • Write tools never run without an applicable policy

3. Add approvals and budgets

Outcome: Risk, time, and cost are bounded before execution.

Tasks

  • Define approval gates
  • Add token/cost budgets
  • Add a timeout
  • Add cancellation

Checks

  • High-risk actions always wait for approval
  • Budget exhaustion ends the cycle safely

4. Verify auditability and rollback

Outcome: An action can be explained, replayed, or rolled back.

Tasks

  • Log decision inputs
  • Persist tool results
  • Add a rollback handler
  • Run a failure drill

Checks

  • The audit log reconstructs the sequence
  • Rollback has evidence

Acceptance criteria

  • A deterministic state machine exists
  • Every tool has a risk and permission policy
  • Write actions require approval
  • The agent has time/cost/step limits
  • The failure drill and rollback pass

Assessment rubric

How the result is assessed

Passing score: 75/100 · Distinction: 92/100

State machine and stop conditions

States, transitions, terminal outcomes, and recovery are explicit.

25 points

Insufficient

Behavior depends on a hidden or unbounded loop.

Competent

Every state has an exit condition and explicit limits.

Strong

Deterministic replay, recovery states, and property tests are implemented.

Evidence required

  • ✓ Link to code or artifact
  • ✓ Short README explaining decisions
  • ✓ Test output or runtime evidence
  • ✓ State diagram or transition table

Tool governance

Every tool has a schema, permission scope, risk level, and dry-run policy.

25 points

Insufficient

Tools are invoked without explicit contracts or access boundaries.

Competent

The registry defines contracts, risks, and permissions.

Strong

Policies are enforced by a separate policy engine and covered by tests.

Evidence required

  • ✓ Link to code or artifact
  • ✓ Short README explaining decisions
  • ✓ Test output or runtime evidence
  • ✓ Tool registry

Approvals and budgets

Risky actions, time, steps, and cost are bounded before execution.

25 points

Insufficient

Write actions can run without approval or limits.

Competent

Approval gates and budgets block unsafe actions.

Strong

Risk-based policy, cancellation, and delegated approvals are implemented.

Evidence required

  • ✓ Link to code or artifact
  • ✓ Short README explaining decisions
  • ✓ Test output or runtime evidence
  • ✓ Example approval request and budget-exhaustion result

Auditability and rollback

The decision sequence is reproducible and changes have rollback evidence.

25 points

Insufficient

The audit trail is incomplete or rollback is only declarative.

Competent

The audit log reconstructs the cycle and rollback is verified.

Strong

Tamper-evident logging, replay, and an automated recovery drill are implemented.

Evidence required

  • ✓ Link to code or artifact
  • ✓ Short README explaining decisions
  • ✓ Test output or runtime evidence
  • ✓ Failure drill and rollback report