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

cordon-sdk

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordon-sdk

TypeScript config SDK for Cordon — the security gateway for AI agents

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
2
-80%
Maintainers
1
Weekly downloads
 
Created
Source

cordon-sdk

TypeScript SDK for configuring Cordon, the security gateway for MCP tool calls.

This package exports defineConfig and the config type surface. You only need it if you're writing a cordon.config.ts file.

Install

npm install cordon-sdk

cordon init (from the cordon-cli package) installs this automatically into your project.

Usage

import { defineConfig } from 'cordon-sdk';

export default defineConfig({
  servers: [
    {
      name: 'database',
      transport: 'stdio',
      command: 'npx',
      args: ['-y', '@modelcontextprotocol/server-postgres', process.env.POSTGRES_URL!],
      policy: 'read-only',
    },
    {
      name: 'github',
      transport: 'stdio',
      command: 'npx',
      args: ['-y', '@modelcontextprotocol/server-github'],
      policy: 'approve-writes',
      tools: {
        delete_repository: 'block',
        create_pull_request: 'approve',
      },
    },
  ],

  audit: {
    enabled: true,
    output: 'file',       // 'stdout' | 'file' | 'hosted'
  },

  approvals: {
    channel: 'terminal',  // 'terminal' | 'slack'
    timeoutMs: 60_000,
  },

  rateLimit: {
    perServerPerMinute: 60,
  },
});

Policy actions

PolicyBehavior
allowPass through immediately
blockReject with an error
approvePause the agent, prompt for human approval
approve-writesReads pass through, writes require approval
read-onlyWrites are blocked, reads pass through
log-onlyPass through, flagged in audit log
hiddenFiltered from tools/list — the model never sees it

Policies can be set at the server level or per-tool. Per-tool overrides the server default.

Closed-world tool catalogs

Opt into a strict list of tools your upstream server is allowed to advertise. New tools added in future upstream releases are blocked until you approve them explicitly:

{
  name: 'postgres',
  transport: 'stdio',
  command: 'npx',
  args: ['-y', '@modelcontextprotocol/server-postgres', process.env.POSTGRES_URL!],
  policy: 'read-only',
  knownTools: ['query', 'list_tables', 'describe_table'],
  onUnknownTool: 'block',  // default when knownTools is set
}
  • knownTools: string[] — tools you've vouched for. Tools keyed in tools (with explicit policy overrides) are also treated as known.
  • onUnknownTool: 'block' | 'allow' — default 'block'. With 'allow', unknown tools still pass through but emit a stderr warning.
  • Leave knownTools undefined to disable the check (backwards compatible).

Full documentation

Complete reference including all config fields, approval channels, and audit outputs: https://github.com/marras0914/cordon

License

MIT

Keywords

mcp

FAQs

Package last updated on 24 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