agentleFS
guerrilla2799guerrilla2799/ops-and-scale-os/skills/agent-guardrails/SKILL.md

agent-guardrails

Skill1 starsChanged 3 months agoMITView on GitHub

Use before shipping any agent to another person, or when the user says "guardrails", "the agent did something it shouldn't", "spend limits", "it emailed the wrong person", "safety rails", "what stops it from", "it wrote to the CRM". Defines the refusal set, spend ceilings, mandatory pre-checks, escalation paths, and human gates, then puts the hard ones where persuasion cannot reach them. Writes workspace/agents/<name>/guardrails.md.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before any agent reaches somebody other than its author

    line 12
  2. Distinctive:

    Before granting write access to a system of record

    line 14
  3. Distinctive:

    Before granting access to a spending key

    line 15
  4. Distinctive:

    Per-user keys, per-user ceilings: Always

    line 111

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent Guardrails

The guardrail layer is not overhead on the useful part. In production it decides whether the thing survives contact with a real user.

When to use

  • Before any agent reaches somebody other than its author
  • After an incident
  • Before granting write access to a system of record
  • Before granting access to a spending key

Inputs

  • Reads: workspace/agents/<name>/brief.md, workspace/agents/context/guardrails.md
  • Needs from user: what a bad output would cost, who else has access, and which systems the agent can write to

Workflow

1. Write the refusal set

What the agent will not do, stated positively as refusals rather than left to inference.

This agent will NOT:
- Contact any account with an open opportunity
- Reference a named customer without a clearance marker
- Send anything. It drafts, a human sends
- Exceed <n> rows or <n> searches per run
- Write to <object> in the CRM
- Invent a statistic. Unknown values are marked [unverified]

"Never invent a number" belongs in every refusal set. A fabricated metric in a customer-facing email is the highest-cost failure mode in GTM agents, and it is the most likely one.

2. Install the mandatory pre-checks

Things that run before the work, not after.

Pre-checkWhyCost of skipping
CRM conflict checkThe account may be in an active dealA rep's deal disrupted by an automated touch
Suppression list checkCustomers, competitors, do-not-contactProspecting a board member
Balance and ceiling checkSpend is about to happenThe credit fire
Freshness checkThe data may be staleConfident outreach on a person who left
Clearance checkProof points may be unclearedAn uncleared metric on a public surface

The CRM conflict check is the one that buys the most trust with a sales team. An agent that visibly protects their pipeline gets adopted. One that does not gets blocked, correctly.

3. Place each guardrail at the right strength

The central design question. Where a rule lives determines whether it holds.

PlacementStrengthUse for
Written in the skill bodyAdvisory. A determined instruction talks past itStyle rules, preferences, budgets
Enforced by a hookHard. Not subject to persuasionMandatory logging, spend pre-checks
Configured in the vendor accountHard. Fails closedSpend ceilings, rate limits
Human approval gateHard, and slow, which is sometimes the pointSending, spending, writing to systems of record
Absent from the tool entirelyAbsoluteCapabilities the agent should simply not have

The last row is the strongest guardrail and the most underused. If an agent has no reason to write to the CRM, do not connect write access. A capability that does not exist cannot be misused.

4. Set the spend guardrails specifically

Per-run row cap:        <n>       (advisory, in the skill)
Per-run search budget:  <n>       (advisory, in the skill)
Deep research mode:     off, requires explicit confirmation
Per-user key:           yes, one key per user, never shared
Account ceiling:        <amount>  (hard, configured in the vendor account)

Per-user keys with per-user ceilings. A shared key with no per-user limit is one bad afternoon from the month's budget, and this has happened to real teams with real numbers.

5. Define the escalation path

An agent that is unsure needs somewhere to go other than guessing.

When <condition>, stop and escalate to <named person> with <what to include>.

Conditions worth escalating on: a conflict the agent cannot resolve, a request outside the defined scope, a proof point with no clearance, or an estimate over the spend threshold.

Escalation must name a person. "Ask a human" gets ignored, because everyone assumes it means someone else.

6. Tune the trip rate

Guardrail trip rate is a real metric.

Trip rateReading
0%The guardrails are not real. Nothing is being tested
2 to 10%Healthy. They are catching real cases
Over 20%Scope is wrong. The agent is being asked for work it should not do

Zero is not a good score. It means either nobody is using the agent or the guardrails do not describe anything that happens.

Output

  • Writes: workspace/agents/<name>/guardrails.md
  • Uses: templates/guardrails-template.md
  • Prints: the refusal set, the pre-check list, a placement table showing where each guardrail lives and its strength, the escalation path, and the spend configuration

Rules & quality bar

  • Every guardrail has a stated placement and strength. A rule with no placement is a wish
  • Hard limits live outside the prompt. Vendor ceilings and hooks, not instructions
  • Per-user keys, per-user ceilings. Always
  • CRM conflict check before any list, brief, or outreach
  • "Never invent a number" in every refusal set, with [unverified] as the escape hatch
  • Anything that sends, spends, or writes to a system of record has a human gate
  • Escalation names a person
  • Remove capabilities that are not needed. The strongest guardrail is absence
  • A 0% trip rate means the guardrails are decorative

Related skills

  • Requires: agent-scoping, context-portfolio
  • Pairs with: credit-and-cost-control for the spend side
  • Hands off to: agent-rollout
  • See also: docs/build-surface.md on hooks, docs/field-notes.md story 1

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.