Overview
agent-hooks-rs is the Rust integration surface for Sigil pre-tool authorization. It provides:
sigil-agent-hooks-core— a generic Rust client for Sigil Sign/v1/authorizesigil-agent-hooks-ironclaw— a native IronClawHooktrait adapter
@sigilcore/agent-hooks package, so both implementations emit the same /v1/authorize request bodies for the same intents.
Installation
Generic Rust Client
UseSigilClient directly when you want framework-agnostic pre-tool authorization in any Rust host.
IronClaw Hook
For IronClaw agents,IronclawSigilHook implements the Hook trait and registers on BeforeToolCall.
| Tool aliases | Sigil action |
|---|---|
exec, process, code_execution | bash |
write, edit, apply_patch | file_write |
web_fetch, web_search, x_search, browser, http | web_fetch |
wallet_transfer, wallet.transfer | wallet.transfer |
wallet_sign | wallet_sign |
ToolIntentMapper and pass it to IronclawSigilHook::builder(client).mapper(...).
Configuration
| Builder method | Default | Description |
|---|---|---|
builder(api_key) | required | Sigil API key |
.api_url(url) | https://sign.sigilcore.com | Sigil Sign API URL |
.agent_id(id) | "agent" | Agent identifier |
.framework(id) | AgentHooks | Framework identifier for the authorize request |
.fail_mode(mode) | Closed | Behavior when Sigil is unreachable |
.request_timeout(dur) | 5s | HTTP request timeout |
FrameworkId::AgentHooks to FrameworkId::Ironclaw, so IronClaw authorize requests carry the correct framework identifier.
Fail Modes
agent-hooks-rs defaults to FailMode::Closed.
| Mode | Unreachable result | Use when |
|---|---|---|
FailMode::Closed | DENIED with SIGIL_UNREACHABLE | Production, externally-visible actions, and wallet or on-chain actions |
FailMode::Open | APPROVED with fail_open: true | Development or non-financial workflows |
401 or 403) return SIGIL_AUTH_FAILURE, not SIGIL_UNREACHABLE.
Wire Parity
The Rust and TypeScript packages sharecontract-fixtures/v1/ files that pin the exact JSON wire format of /v1/authorize request bodies. Both test suites verify the fixture SHA-256 checksums and byte-compare generated request bodies against the fixtures.