> ## Documentation Index
> Fetch the complete documentation index at: https://apie.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Guardrail packs

> Walkthrough — exercise five risky action scenarios in monitor mode to preview guardrail decisions.

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](https://github.com/ratri-sh/javascript-sdk/blob/main/examples/guardrail-packs-smoke.ts) · [guardrail\_packs\_smoke.py](https://github.com/ratri-sh/python-sdk/blob/main/examples/guardrail_packs_smoke.py)

## The five scenarios

| # | Tool              | Action  | Resource          | Risk     |
| - | ----------------- | ------- | ----------------- | -------- |
| 1 | `deploy.release`  | execute | deployment\_event | high     |
| 2 | `vault.read`      | read    | secret            | high     |
| 3 | `db.update`       | update  | database\_record  | high     |
| 4 | `github.merge_pr` | merge   | code\_repository  | high     |
| 5 | `shell.rm_rf`     | delete  | shell\_command    | critical |

## Run the smoke test

<CodeGroup>
  ```ts TypeScript theme={null}
  await ratri.withRun(
    { inputSummary: "Exercise starter guardrail packs in monitor mode" },
    async (run) => {
      for (const scenario of scenarios) {
        await ratri.withTool(
          { runId: run.id, ...scenario },
          async () => ({ ok: true }),
        );
      }
    },
  );
  ```

  ```python Python theme={null}
  def smoke(run):
      for scenario in scenarios:
          ratri.with_tool({"runId": run.id, **scenario}, lambda: {"ok": True})

  ratri.with_run({"inputSummary": "Exercise guardrail packs"}, smoke)
  ```
</CodeGroup>

### 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:

<CodeGroup>
  ```bash TypeScript theme={null}
  npx ratri guardrails enable prod-secrets
  npx ratri guardrails enable prod-deploys
  ```

  ```bash Python theme={null}
  ratri guardrails enable prod-secrets
  ratri guardrails enable prod-deploys
  ```
</CodeGroup>

## Escalate to Enforce mode

1. Review evaluation events in the dashboard
2. [Declare capabilities](/boundaries/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](/guardrails/enforce-guardrails).

## Next steps

<CardGroup cols={2}>
  <Card title="Monitor mode" icon="eye" href="/guardrails/monitor-mode">
    How monitor mode works.
  </Card>

  <Card title="Enable guardrail templates" icon="puzzle" href="/guardrails/enable-guardrail-templates">
    Turn on starter packs.
  </Card>
</CardGroup>
