
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@getcordon/policy
Advanced tools
TypeScript SDK for configuring Cordon for MCP — the security gateway for MCP tool calls.
TypeScript SDK for configuring Cordon for MCP — 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.
npm install @getcordon/policy
cordon init (from the @getcordon/cli package) installs this automatically into your project.
import { defineConfig } from '@getcordon/policy';
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',
},
approvals: {
channel: 'terminal',
timeoutMs: 60_000,
},
rateLimit: {
perServerPerMinute: 60,
},
});
| Policy | Behavior |
|---|---|
allow | Pass through immediately |
block | Reject with an error |
approve | Pause the agent, prompt for human approval |
approve-writes | Reads pass through, writes require approval |
read-only | Writes are blocked, reads pass through |
log-only | Pass through, flagged in audit log |
hidden | Filtered from tools/list — the model never sees it |
sql-read-only | Parse the SQL arg; allow SELECT, block everything else (fail-closed on unparseable) |
sql-approve-writes | Parse the SQL arg; allow reads, pause writes for approval, block unparseable |
Policies can be set at the server level or per-tool. Per-tool overrides the server default.
For database MCP servers where a single tool takes arbitrary SQL, Cordon can parse the statement and decide based on type rather than tool name:
tools: {
query: 'sql-read-only', // default: inspects arg named 'sql'
execute: 'sql-approve-writes',
run: { action: 'sql-read-only', sqlArg: 'statement' }, // custom arg name
}
SELECT, WITH ... SELECT CTEs, SHOW, bare EXPLAIN SELECT/... (the leading EXPLAIN is stripped before classifying the inner statement).EXPLAIN ANALYZE is deliberately NOT stripped (ANALYZE actually executes the query) and falls through to unknown.The underlying node-sql-parser doesn't parse these in PG mode, so they fall through to 'unknown' and get blocked under sql-read-only (you'd need to switch to sql-approve-writes, add a tool-level override, or wrap the intent in a supported form):
DESCRIBE users / DESC users (MySQL-style; use SELECT * FROM information_schema.columns WHERE table_name = 'users' instead)VALUES (1, 2), (3, 4) (wrap in SELECT * FROM (VALUES ...) AS t(a,b))PRAGMA foreign_keys = ON (SQLite-specific)EXPLAIN ANALYZE ... (deliberately not supported — ANALYZE runs the query)FAQs
TypeScript SDK for configuring Cordon for MCP — the security gateway for MCP tool calls.
We found that @getcordon/policy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.