Overview
OpenRouter is a model gateway, not an execution runtime. The model never runs tools itself: it returns atool_calls array, and your
host code executes the tool and feeds the result back. That execution boundary
in your host is exactly where Sigil Open Framework (SOF) belongs. Before you run
any tool call OpenRouter returns, submit it to Sigil Sign /v1/authorize and
block on DENIED.
Because this hooks the execution step rather than any OpenRouter-specific feature,
the same pattern works for every model OpenRouter routes to. Set
framework: 'openrouter' so the intents are tagged correctly in your audit log.
Prerequisites
- A Sigil API key: sigilcore.com/tools/keys
- A signed policy: sigilcore.com/tools/warrant
- An OpenRouter API key
Usage
RuncheckIntent on each returned tool call before executing it. Map the
function name to a Sigil action type and pass the parsed arguments through as the
intent fields plus metadata for custom policy rules.
How It Works
buildRejectionContext produces a typed JSON object the model
understands (sigil_decision, sigil_message, sigil_next_steps), so the agent
adjusts instead of blindly retrying. The model never executes anything: your host
remains the single enforcement point.
Notes
- This pattern is provider-agnostic. The same
checkIntentcall governs OpenAI, Anthropic, Google, and open-weight models served through OpenRouter. - If you also expose MCP servers to the agent, govern those calls with the Sigil MCP Proxy so MCP tools are authorized at the protocol layer as well.
- For multi-turn loops, the OpenRouter Agent SDK
manages tool execution for you. Wrap its tool handlers with
executeWithSigilto keep the same enforcement boundary.
Configuration
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey | string | Yes | — | Sigil API key (sk_sigil_...) |
apiUrl | string | No | https://sign.sigilcore.com | Sigil Sign endpoint |
agentId | string | No | 'agent' | Agent identifier |
framework | string | No | 'agent-hooks' | Use 'openrouter' for telemetry and audit routing |
failMode | 'open' | 'closed' | No | 'open' | Block (closed) or allow (open) when Sigil is unreachable |
Source
- github.com/Sigil-Core/agent-hooks — TypeScript package, MIT License
- OpenRouter tool calling documentation