Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sigilcore.com/llms.txt

Use this file to discover all available pages before exploring further.

Installation

npm install @sigilcore/agent-hooks

Usage

import { checkElizaAction } from '@sigilcore/agent-hooks';

const config = {
  apiKey: process.env.SIGIL_API_KEY!,
  agentId: 'my-eliza-agent',
};

// Before any ELIZA action:
const blocked = await checkElizaAction(
  { name: 'SEND_TOKEN', params: { to: '0x...', amount: '1.0' } },
  config
);

if (blocked) {
  console.error('Blocked by Sigil:', blocked.rejection);
  return;
}
// Action is approved — proceed

How It Works

checkElizaAction maps the ELIZA action name to a Sigil action type (lowercased), submits it to /v1/authorize, and returns null on approval or a rejection object on denial or hold.
// Returns null if approved
// Returns { blocked: true, rejection: SigilRejectionContext } if denied or pending

Configuration

FieldTypeRequiredDefaultDescription
apiKeystringYesSigil API key (sk_sigil_...)
apiUrlstringNohttps://sign.sigilcore.comSigil Sign endpoint
agentIdstringNo'agent'Agent identifier
onDeniedfunctionNoCalled when action is denied
onPendingfunctionNoCalled when action is held
onErrorfunctionNoCalled on network error