🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@sidclaw/sdk

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sidclaw/sdk

Governance SDK for AI agents — identity, policy, approval, and audit

Source
npmnpm
Version
0.1.8
Version published
Weekly downloads
105
-74.26%
Maintainers
1
Weekly downloads
 
Created
Source

@sidclaw/sdk

npm version License: Apache-2.0 CI

Governance for AI agents. Identity, policy, approval, and audit.

Documentation · Quick Start · Examples

Quick Start

1. Install

npm install @sidclaw/sdk

2. Initialize

import { AgentIdentityClient } from '@sidclaw/sdk';

const client = new AgentIdentityClient({
  apiKey: process.env.AGENT_IDENTITY_API_KEY,
  apiUrl: 'https://api.sidclaw.com',
  agentId: 'your-agent-id',
});

3. Govern your agent's actions

import { withGovernance } from '@sidclaw/sdk';

const sendEmail = withGovernance(client, {
  operation: 'send_email',
  target_integration: 'email_service',
  resource_scope: 'customer_emails',
  data_classification: 'confidential',
}, async (to, subject, body) => {
  // your actual send logic
});

await sendEmail('customer@example.com', 'Follow-up', '...');
// If policy says "approval_required", this waits for a human to approve
// If policy says "deny", this throws ActionDeniedError
// If policy says "allow", this executes immediately

Integrations

MCP Governance Server

Wrap any MCP server with governance — intercepts tool calls automatically.

import { AgentIdentityClient, GovernanceMCPServer } from '@sidclaw/sdk';

const server = new GovernanceMCPServer({
  client,
  upstream: { transport: 'stdio', command: 'npx', args: ['your-mcp-server'] },
  toolMappings: [
    { toolName: 'query', data_classification: 'confidential' },
    { toolName: 'list_tables', skip_governance: true },
  ],
});
await server.start();

LangChain.js

import { governTools } from '@sidclaw/sdk/langchain';

const governedTools = governTools(myTools, { client });

Vercel AI SDK

import { governVercelTool } from '@sidclaw/sdk/vercel-ai';

const governedTool = governVercelTool('myTool', myTool, { client });

OpenAI Agents SDK

import { governOpenAITool } from '@sidclaw/sdk/openai-agents';

const governedTool = governOpenAITool(myTool, { client });

Webhook Verification

import { verifyWebhookSignature } from '@sidclaw/sdk/webhooks';

const isValid = verifyWebhookSignature(rawBody, signatureHeader, webhookSecret);

OpenClaw Integration

Add governance to any OpenClaw MCP server:

  • Install the skill: openclaw skills install sidclaw-governance
  • Replace your MCP server config in openclaw.json:
{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "@sidclaw/sdk", "mcp-proxy"],
      "env": {
        "SIDCLAW_API_KEY": "ai_...",
        "SIDCLAW_AGENT_ID": "agent-...",
        "SIDCLAW_UPSTREAM_CMD": "npx",
        "SIDCLAW_UPSTREAM_ARGS": "-y,@modelcontextprotocol/server-postgres,postgresql://..."
      }
    }
  }
}

Every tool call is now evaluated against your SidClaw policies.

Error Handling

import { ActionDeniedError, ApprovalTimeoutError } from '@sidclaw/sdk';

try {
  await governedAction();
} catch (error) {
  if (error instanceof ActionDeniedError) {
    console.log('Denied:', error.reason, 'Trace:', error.traceId);
  }
}

License

Apache 2.0

Keywords

ai-agent

FAQs

Package last updated on 02 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts