constrain

constrain is a skill for Claude Code, Codex from synaptiai/agent-capability-standard. It costs 39 tokens per session (2,258 once invoked), scanned A, original, Apache-2.0.

A policy and permission check that evaluates a proposed action and limits it to the smallest safe scope.

In plain words
What is it for?
Use it to allow, block, warn about, or log actions based on policies, permissions, enforcement levels, and context.
Why use it?
It prevents unsafe or unauthorized work by applying relevant rules before an action is taken.

Skill for Claude CodeCodex

Part of the agent-capability-standard plugin — 42 skills, 2 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/synaptiai/agent-capability-standard/constrain
Any agent
npx skills add synaptiai/agent-capability-standard --skill constrain
Clone the repo
git clone --depth 1 https://github.com/synaptiai/agent-capability-standard

Made for: Claude Code, Codex.

Or install agent-capability-standard, the plugin that ships this one along with the rest of its 42 skills, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for constrain

README.md
[![agentmods](https://agentmods.dev/badge/skills/synaptiai/agent-capability-standard/constrain.svg)](https://agentmods.dev/skills/synaptiai/agent-capability-standard/constrain)
Your own site
<a href="https://agentmods.dev/skills/synaptiai/agent-capability-standard/constrain"><img src="https://agentmods.dev/badge/skills/synaptiai/agent-capability-standard/constrain.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,258 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.02258
Opus 5 $0.00019 $0.01129
Sonnet 5 $0.00008 $0.00452
Haiku 4.5 $0.00004 $0.00226

Measured 5d ago against content hash 5683cba731de, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

constrain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/constrain/SKILL.md · 311 lines

How it starts

The opening of the file, as written. The whole thing — 311 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Intent

Execute constrain to evaluate proposed actions against defined policies, enforce permission boundaries, and reduce scope to the minimum required for safe operation. This is the gatekeeper that prevents unsafe actions before they execute.

Success criteria:

  • All relevant policies evaluated for the proposed action
  • Clear allow/deny decision with rationale
  • Scope reduced to minimum necessary permissions
  • Violation actions documented (block, warn, log)

Compatible schemas:

  • schemas/output_schema.yaml

Inputs

Parameter Required Type Description
action Yes object The proposed action to evaluate (capability, target, parameters)
policy_id No string Specific policy to evaluate against (default: all applicable)
scope No object Current permission scope to constrain
enforcement_level No enum strict (block), advisory (warn), audit (log only)
context No object Additional context for policy evaluation (user, session, etc.)

Procedure

  1. Identify applicable policies: Find all policies relevant to the action

    • Load policy definitions from .policies/ or policy registry
    • Match action type to policy triggers
    • Consider context (user role, environment, time) for policy selection
  2. Evaluate preconditions: Check if action meets basic safety requirements

    • Is action within workspace boundaries?
    • Does action target sensitive resources (.env, credentials)?
    • Is checkpoint required but missing?
    • Is approval required but not obtained?
  3. Apply policy rules: Evaluate each policy condition

    • Parse policy conditions (AND/OR/NOT expressions)
    • Check each condition against action parameters
    • Record which conditions pass and which fail
    • Determine overall policy verdict (allow/deny/conditional)
  4. Reduce scope: Apply least privilege principle

    • Identify minimum permissions needed for action
    • Remove unnecessary permissions from scope
    • Document removed permissions and rationale

Read the full file on GitHub · 311 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 311 lines · 39 tokens per session scan A 5683cba731de

Subscribe to this mod's changes

constrain is a skill published in the GitHub repository synaptiai/agent-capability-standard (4 stars, last pushed 6d ago), licensed Apache-2.0. It adds 39 tokens to every session and 2,258 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.