
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@runestone-labs/gatekeeper-client
Advanced tools
TypeScript client for Runestone Gatekeeper - policy enforcement for AI agent tools
A minimal, framework-agnostic TypeScript client for Runestone Gatekeeper.
npm install @runestone-labs/gatekeeper-client
import { GatekeeperClient } from '@runestone-labs/gatekeeper-client';
// Initialize client
const gk = new GatekeeperClient({
baseUrl: 'http://127.0.0.1:3847',
agentName: 'my-agent',
agentRole: 'openclaw',
runId: 'optional-correlation-id'
});
// agentRole is required unless you set GATEKEEPER_ROLE in the environment.
// Or simply (requires GATEKEEPER_ROLE):
const gk = new GatekeeperClient('http://127.0.0.1:3847');
// Execute a shell command
const result = await gk.shellExec({ command: 'ls -la' });
if (result.decision === 'allow') {
// Command was executed
console.log(result.result.stdout);
} else if (result.decision === 'approve') {
// Human approval required
console.log('Waiting for approval:', result.approvalId);
console.log('Expires:', result.expiresAt);
} else {
// Denied by policy
console.error('Denied:', result.humanExplanation);
}
shellExec(args)Execute a shell command.
await gk.shellExec({
command: 'npm install',
cwd: '/path/to/project',
timeoutMs: 30000
});
filesWrite(args)Write a file.
await gk.filesWrite({
path: '/tmp/output.txt',
content: 'Hello, world!',
encoding: 'utf8'
});
httpRequest(args)Make an HTTP request.
await gk.httpRequest({
url: 'https://api.example.com/data',
method: 'POST',
headers: { 'Authorization': 'Bearer token' },
body: JSON.stringify({ key: 'value' })
});
callTool(tool, args)Low-level method for calling any tool.
await gk.callTool('shell.exec', { command: 'echo hello' }, {
idempotencyKey: 'req-123',
origin: 'external_content',
taint: ['external'],
dryRun: true
});
health()Check if Gatekeeper is running.
const status = await gk.health();
console.log(status.version, status.demoMode);
All methods return a GatekeeperResult<T>:
interface GatekeeperResult<T> {
decision: 'allow' | 'approve' | 'deny';
requestId: string;
reasonCode?: string;
humanExplanation?: string;
remediation?: string;
policyVersion?: string;
idempotencyKey?: string;
// When decision === 'allow'
result?: T;
success?: boolean;
executionReceipt?: ExecutionReceipt;
// When decision === 'approve'
approvalId?: string;
expiresAt?: string;
approvalRequest?: ApprovalRequestDetails;
// When decision === 'deny'
denial?: DenialDetails;
}
See the integrations/ directory for examples of wrapping this client for specific agent frameworks:
@runestone-labs/gatekeeper-mcp) that wraps this client so any MCP client (Claude Desktop, Claude Code, Cursor) routes its tool calls through GatekeeperApache-2.0
FAQs
TypeScript client for Runestone Gatekeeper - policy enforcement for AI agent tools
The npm package @runestone-labs/gatekeeper-client receives a total of 23 weekly downloads. As such, @runestone-labs/gatekeeper-client popularity was classified as not popular.
We found that @runestone-labs/gatekeeper-client 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.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

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.