Overview
@sigilcore/agent-hooks supplies authorization adapters for agent runtimes. An
adapter maps an intended action to Sigil Sign /v1/authorize and returns the
result in the shape its host expects.
An adapter is an enforcement boundary only when the host invokes it before the
action, honors a denial, and fails closed if the adapter crashes, times out, or
returns malformed output. Some integrations meet that contract. Others are
decision helpers or best-effort callbacks. The table below states the current
boundary for each integration.
The TypeScript package is the JavaScript integration surface. Rust hosts use the companion agent-hooks-rs crates, which share the same /v1/authorize wire fixtures and add a native IronClaw hook adapter.
Installation
How It Works
For an in-path integration, the request flow is:Supported Frameworks
Some integrations ship as dedicated package exports. Others are documented patterns built oncheckIntent because the runtime boundary lives in a script,
host loop, payment wrapper, or transport layer. The dedicated adapters should
grow over time for popular harnesses where a generic call hides important
runtime nuance.
Enforcement Coverage
Documented Integration Patterns
For MCP clients, govern calls at the transport layer with the
Sigil MCP Proxy. This covers only MCP traffic routed
through that proxy. It does not cover native tools or parallel direct
connectors.
See the Framework Registry for the full list and custom framework usage.
Model Budget Brakes
v2-compatible hosts can userecordModelUsage, getModelUsageReport, clearModelUsage, and checkModelBudget to enforce max_model_spend_usd_per_task and max_model_tokens_per_task from ## execution_limits.
The host or adapter records provider usage after each model call, then sends the cumulative task total to Sigil Sign as intent.metadata.model_usage on a model.inference check. Sigil evaluates the signed cap deterministically. It does not call the model provider, proxy inference traffic, or calculate pricing from a provider table.
The v2 model-budget helper surface ships in both packages. TypeScript hosts use
recordModelUsage, getModelUsageReport, clearModelUsage, and
checkModelBudget. Rust hosts use record_model_usage,
get_model_usage_report, clear_model_usage, and check_model_budget.
IronClaw’s native hook currently sees BeforeToolCall events, not provider
usage. Use the Rust core helpers in the host code that wraps model provider
calls, then let the IronClaw hook continue to gate tool execution.
Governed Actions
HTTP adapter rule: emit
http only when the intercepted tool input explicitly contains a valid method. Never infer GET; when the method is absent, keep the legacy web_fetch action. web_fetch has an unknown method and cannot satisfy a non-empty HTTP method allowlist.
MCP calls use the transport proxy’s namespaced action and carry the exact
metadata.serverId, metadata.toolName, and metadata.arguments values that
the proxy observed. The action string is a routing identifier. Sign never
splits it to recover policy identity. A normal client-side proxy key has
agent provenance because the governed agent can reuse that bearer key. Only a
controlled proxy deployment with a dedicated inaccessible credential receives
shim provenance and can satisfy require_shim: true or an attested
allowlist rule.
Prerequisites
You need a Sigil API key and a signedwarranty.md policy file deployed to Sigil Sign.
- Get an API key: sigilcore.com/tools/keys
- Generate a policy: sigilcore.com/tools/warrant
Fail Modes
When Sigil Sign is unavailable or returns an unusable response, agent-hooks can either fail open or fail closed. This covers network errors, DNS failures, refused connections, request timeouts, 5xx responses, and non-JSON response bodies. This setting controls the adapter’s result. It cannot repair a host that skips the adapter, terminates it, or ignores its result.TypeScript: @sigilcore/agent-hooks
The TypeScript package defaults to failMode: 'open' for backward compatibility with v0.1.0.
In open mode, fallback approvals carry
failOpen: true so hosts can distinguish an outage fallback from a real policy approval. In closed mode, buildRejectionContext tells the agent to pause and retry after connectivity is restored; it does not frame the event as a policy violation.
Rust: agent-hooks-rs
The Rust crates default to FailMode::Closed because they have no legacy fail-open behavior to preserve. They expose FailMode::Open for development or low-risk workflows.
Rust and IronClaw
Use
sigil-agent-hooks-core directly from Rust or sigil-agent-hooks-ironclaw
as a native IronClaw Hook.Source
- github.com/Sigil-Core/agent-hooks — TypeScript package, MIT License
- github.com/Sigil-Core/agent-hooks-rs — Rust crates, MIT License