Skip to main content
Before enabling Enforce mode, you want to see which guardrail templates match your agent’s risky actions. This recipe runs five scenarios — deploy, vault, database, merge, and shell — in Monitor mode. Source: guardrail-packs-smoke.ts · guardrail_packs_smoke.py

The five scenarios

#ToolActionResourceRisk
1deploy.releaseexecutedeployment_eventhigh
2vault.readreadsecrethigh
3db.updateupdatedatabase_recordhigh
4github.merge_prmergecode_repositoryhigh
5shell.rm_rfdeleteshell_commandcritical

Run the smoke test

await apie.withRun(
  { inputSummary: "Exercise starter guardrail packs in monitor mode" },
  async (run) => {
    for (const scenario of scenarios) {
      await apie.withTool(
        { runId: run.id, ...scenario },
        async () => ({ ok: true }),
      );
    }
  },
);

What you’ll see

Five agent.tool.called events and five agent.guardrail.evaluated events. Each evaluation shows the matched template and decision. In Monitor mode, all callbacks succeed regardless of decision.

Before running

Enable guardrail templates:
npx apie guardrails enable prod-secrets
npx apie guardrails enable prod-deploys

Escalate to Enforce mode

  1. Review evaluation events in the dashboard
  2. Declare capabilities for all five tools
  3. Switch mode to "enforce"
  4. Re-run — blocked scenarios will throw before the callback executes
See Enforce guardrails.

Next steps

Monitor mode

How monitor mode works.

Enable guardrail templates

Turn on starter packs.