synaptiai/agent-capability-standard/constrain
Claude Code and agent skill by synaptiai/agent-capability-standard
- community
Checking that the SKILL.md file is still in the repository.
Enforce policies, guardrails, and permission boundaries; refuse unsafe actions and apply least privilege. Use when evaluating actions against policies, checking permissions, or reducing scope to safe boundaries.
Install
npx vskill@latest install synaptiai/agent-capability-standard/constrainSKILL.md
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 | |
|---|---|---|---|---|
target | Yes | any | What to constrain | |
constraints | Yes | array | Constraints to enforce | |
action_on_violation | No | string | What to do on a violation: block, warn, or log |
Inputs not listed here are outside the capability's contract: a workflow step that binds them gets W604 (STANDARD v1.1 §5.5).
In a workflow, a constrain step that blocks can count independent reviews with a quorum (Standard v1.1 quorum@1): earlier delegate steps are the reviewers, and the output gains a tally of passes, blocks, abstentions, full-sweep passes and voters. See ORCHESTRATION_EXTENSIONS.md.
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 the target action's 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
5) Determine enforcement action: Based on policy verdict
block: Prevent action from executingwarn: Allow but alert user to risklog: Record violation but allow action
6) Ground claims: Document policy evaluation evidence
- Format:
policy:<policy_id>:<condition>, decision rationale - Include any scope reductions applied
Output Contract
Return a structured object:
Field Definitions
| Field | Type | Description | |
|---|---|---|---|
constraints_applied | array | List of constraints evaluated and their enforcement | |
policy_evaluation | object | Result of primary policy evaluation | |
scope_reduction | object | How permissions were reduced | |
compliant | boolean | Overall decision: true when no violation is enforced with block, so the action can proceed (workflows gate on ${<step>.compliant}) | |
violations | array | Constraint violations, each with the enforcement applied; warn/log violations leave compliant true | |
actions_taken | array | Enforcement actions performed | |
tally | object | Review quorum count (passes, blocks, abstains, full_passes, voters); present only when the step has a quorum | |
blocked_reason | string | Explanation if action is blocked | |
confidence | number | 0.0-1.0 based on policy coverage | |
evidence_anchors | array | References to policies evaluated | |
assumptions | array | Policy assumptions made |
Examples
Example 1: Constrain File Access to Safe Boundaries
Input:
Output:
Evidence pattern: Policy definitions, path matching against workspace boundary.
Example 2: Constrain API Call with Rate Limiting
Input:
Session abc123 has already made 95 requests this hour.
Output:
Example 3: Constrain Before Execute
Input:
Output:
Verification
Apply the following verification patterns:
- [ ] Policy Coverage: All applicable policies were evaluated
- [ ] Evidence Grounding: Decisions linked to specific policy conditions
- [ ] Scope Reduction Valid: Constrained scope is subset of original
- [ ] Safety Boundary Check: No sensitive files in allowed scope
Verification tools: Read (for policy files), Grep (for policy search)
Safety Constraints
mutation: false (constrain is evaluation only)requires_checkpoint: falserequires_approval: falserisk: low
Capability-specific rules:
- Always evaluate workspace boundary policy
- Always check for sensitive file patterns (.env, credentials, secrets, .pem, .key)
- Apply strictest enforcement when ambiguous
- Never downgrade enforcement level silently
- Log all policy evaluations for audit
Composition Patterns
Commonly follows:
plan- Constrain the planned actions before checkpointcritique- After identifying risks, constrain to mitigate
Commonly precedes:
checkpoint- After constrain approves, create checkpointsend- REQUIRED: constrain before any external communicationexecute/mutate- Constrain as part of pre-execution checks (constrain must precede them)
Anti-patterns:
- CRITICAL: Never skip constrain before send (no unchecked external comms)
- Never ignore blocked_reason and proceed anyway
- Never silently weaken policy enforcement
- Never evaluate constrain after mutation has begun
Workflow references:
- See
reference/composition_patterns.md#digital-twin-sync-loopfor constrain-before-act - See
reference/composition_patterns.md#risk-assessmentfor constrain placement - See
reference/verification_patterns.md#pattern-6-safety-boundary-checkfor boundary checks
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/constrain/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/synaptiai/agent-capability-standard/constrain)