# Salus Agent Guardrails

> Evaluate a proposed agent tool-call against an allow/deny/ask policy before it executes. Given a tool-call JSON and a policy file, runs the dependency-free rule matcher and returns a decision with a human-readable reason. Use this skill whenever an agent is about to take an action that should be checked against a guardrail policy.

- Skill: `riteshkew/salus-agent-guardrails` (Agent Skill, multi-file: 9 files)
- Install (CLI): `npx skillmds@latest add riteshkew/salus-agent-guardrails`
- Raw SKILL.md: https://api.skillmd.com/api/skills/riteshkew/salus-agent-guardrails/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: riteshkew (https://skillmd.com/u/riteshkew)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/riteshkew/salus-agent-guardrails

---


# Workflow

When this skill triggers, follow these steps in order.

## Step 1 — Locate the policy file

Check whether the user has specified a policy file path.

- If a path is provided, confirm the file exists and is readable.
- If no path is provided, ask: "Please provide the path to your policy JSON file. It should be an array of `{ effect, tool, args?, reason }` rules. See `examples/policy.json` for a working example."
- If the user has no policy, offer to generate a starter policy based on their described use-case before proceeding.

## Step 2 — Capture the proposed tool-call

Capture the tool-call the agent is about to execute. It must be valid JSON matching:

```json
{ "tool": "<name>", "args": { "<argName>": "<value>", ... } }
```

Wrap it in a JSON array if it is a single object (the engine accepts an array of calls). If the user provides multiple calls at once, evaluate them all together.

## Step 3 — Run the engine

Execute the rule matcher from the skill root:

```bash
node scripts/policy-eval.mjs <policyFile> <callsFile>
```

The engine outputs a JSON array of `{ tool, decision, reason }` — one entry per call.

Capture stdout. If the process exits non-zero, surface the stderr message to the user and stop.

## Step 4 — Report the decision

For each result:

- **allow** — report the tool name, decision, and reason. The call may proceed.
- **deny** — report the tool name, decision, and the rule that fired. Explain what the agent attempted and why the policy blocked it. Suggest a safe alternative if one exists (e.g. read instead of write, a scoped path instead of a wildcard).
- **ask** — report that the call is paused pending user confirmation. Show the exact tool-call JSON so the user knows exactly what will execute. Wait for explicit approval before proceeding.

### Output format (use this shape in your response)

```
Tool:     <tool>
Decision: ALLOW | DENY | ASK
Reason:   <rule reason text>
```

If decision is DENY or ASK, add a "What to do next" paragraph.

## Example

See `examples/input.md` for a worked scenario with three calls and `examples/output.md` for the corresponding decisions produced by the engine.

Run the example yourself:

```bash
cd skills/salus-agent-guardrails
bash examples/run.sh
```

