Skip to content

Constraints

Constraints are hard behavioral limits that override agent judgment. They are not normative standards (that is governance) and not tool fences (that is permissions). A constraint says: regardless of what the agent decides is correct, this ceiling or boundary applies.

Tagline: Governance defines what is correct. Constraints define what is bounded.

Constraints operate across three dimensions:

  • Resource limits — maximum turns, effort level, token budget; the agent stops when it hits the ceiling regardless of task completion
  • Behavioral guardrails — operations that must never happen (delete production data, push without tests); enforced via PermissionRequest or PermissionDenied hooks
  • Escalation triggers — conditions under which the agent must stop and ask rather than act autonomously
MechanismWhat it controls
Agent frontmatter maxTurnsHard turn ceiling for the subagent
Agent frontmatter effortReasoning effort cap (low / medium / high / xhigh / max)
Hook: PermissionRequestIntercept and block or modify tool calls before they run
Hook: PermissionDeniedReact when a tool call is blocked — log, escalate, or abort
DisciplineAlways-on behavioral guardrails written into AGENTS.md

The first two are structural — the harness enforces them. The last three are behavioral — the agent must follow them, and compliance is verified by observation.

ConstraintsGovernancePermissions
What it limitsBehavior ceilings and guardrailsNormative correctnessTool invocation
Who enforcesHarness (structural) or discipline (behavioral)Agent judgment guided by rulesHarness (always)
Can be overridden by agent?Structural: no. Behavioral: only if discipline compliance failsAgent must follow; failure is a quality defectNo

Escalation is a special class of constraint: instead of stopping the agent, it routes control back to a human or an external verifier. Common patterns:

  • PermissionRequest hook — intercepts a tool call and returns a custom allow/deny decision
  • agent hook type — spawns an agentic verifier to approve or reject the action
  • Discipline rule — “if the action affects shared infrastructure, pause and confirm”

Escalation constraints define the boundary of agent autonomy. They are the mechanism behind “check with the user before proceeding on risky actions.”

Structural constraints (maxTurns, effort) are bundled in the agent definition and travel with the plugin. Hook-based constraints are registered when the plugin is installed. Discipline-based guardrails are injected via SessionStart hooks.

In the plugin schema:

SchemaField
Claude Code agent frontmattermaxTurns, effort
Claude Code hooksPermissionRequest, PermissionDenied, agent hook type
Open Plugin Spec agent frontmattersame pattern
(no top-level plugin field)