OpenAgentIDDocumentation
API referencenpm packages@openagentid/claude-agent
OpenAgentIDAPI reference

@openagentid/claude-agent/policy

API contract shipped by @openagentid/claude-agent 0.1.1. Exact exports, signatures, dependencies and availability.

All packages · Runnable examples · Start an agent

ContractValue
Package@openagentid/claude-agent@0.1.1
Entry point@openagentid/claude-agent/policy
AvailabilityEarlier SDK compatibility
Reference sourcePublished TypeScript declarations
Package enginesnode >=20

Before integrating

Declares an optional peer on @openagentid/sdk ^0.1.0, which excludes SDK 0.7.2. Reference describes the published contract; do not assume compatibility with the current SDK.

This reference is generated from the integrity-verified npm archive for this exact version. Signatures describe the public contract; they are not standalone programs. Complete examples are checked separately.

Import conditions

Use the public entry point above. The package resolves it to these shipped files; do not import its internal files directly.

ConditionPublished file
types./dist/policy.d.ts
import./dist/policy.js
require./dist/policy.cjs

Exports

AllowListSkillsPolicy

Allow-listed skills policy: only the named skills are permitted, and the agent must additionally hold the right scope.

Signature
declare class AllowListSkillsPolicy implements SkillsPolicy {
    constructor(allowedSkills: Iterable<string>, inner?: SkillsPolicy);
    evaluate(skillName: string, ctx: SkillEvaluationContext): Promise<SkillDecision>;
}

Source: @openagentid/claude-agent@0.1.1, dist/policy.d.ts:52.

CompositeSkillsPolicy

Compose multiple policies — a skill is allowed only if every policy allows it. Useful for stacking allow-list + scope + custom policies.

Signature
declare class CompositeSkillsPolicy implements SkillsPolicy {
    constructor(policies: readonly SkillsPolicy[]);
    evaluate(skillName: string, ctx: SkillEvaluationContext): Promise<SkillDecision>;
}

Source: @openagentid/claude-agent@0.1.1, dist/policy.d.ts:62.

DenyUnlessScopedSkillsPolicy

Deny-unless-scoped skills policy.

For a skill named foo, requires the agent to hold skills:invoke:foo (or a wildcard that subsumes it). This is the default policy when the caller passes audit: true without supplying their own.

Signature
declare class DenyUnlessScopedSkillsPolicy implements SkillsPolicy {
    evaluate(skillName: string, ctx: SkillEvaluationContext): Promise<SkillDecision>;
}

Source: @openagentid/claude-agent@0.1.1, dist/policy.d.ts:45.

SKILL_SCOPE_PREFIX

Scope grammar for skill invocations.

Signature
declare const SKILL_SCOPE_PREFIX = "skills:invoke:";

Source: @openagentid/claude-agent@0.1.1, dist/policy.d.ts:18.

skillScope

Build the canonical scope string for a skill name.

Signature
declare function skillScope(name: string): string;

Source: @openagentid/claude-agent@0.1.1, dist/policy.d.ts:22.

StaticCapabilityChecker

Capability checker backed by a fixed allowlist. Supports literal scopes and one wildcard form: prefix:* matches anything starting with prefix:.

Example: tools:invoke:* allows every tool, skills:invoke:web.* allows every skill whose name starts with web..

Signature
declare class StaticCapabilityChecker implements CapabilityChecker {
    constructor(scopes: Iterable<string>);
    check(scope: string): ScopeDecision;
}

Source: @openagentid/claude-agent@0.1.1, dist/policy.d.ts:32.

TOOL_SCOPE_PREFIX

Scope grammar for tool invocations.

Signature
declare const TOOL_SCOPE_PREFIX = "tools:invoke:";

Source: @openagentid/claude-agent@0.1.1, dist/policy.d.ts:20.

toolScope

Build the canonical scope string for a tool name.

Signature
declare function toolScope(name: string): string;

Source: @openagentid/claude-agent@0.1.1, dist/policy.d.ts:24.

Supporting declarations

These package-owned declarations are referenced by the exports above. Their presence here does not make them importable from this entry point. Import only the names in Exports.

CapabilityChecker

Anything implementing this can authorise tool / skill invocations.

Type-only declaration; it is not a runtime value.

Signature
interface CapabilityChecker {
    check(scope: string): Promise<ScopeDecision> | ScopeDecision;
}

Source: @openagentid/claude-agent@0.1.1, dist/types-BH6j5Zy9.d.ts:41.

OpenAgentIdentity

A verified OpenAgent identity, anchored on a did:oas:* string.

Type-only declaration; it is not a runtime value.

Signature
interface OpenAgentIdentity {
    did: string;
    kind: string;
    displayName?: string;
    publicKey: string;
    sign(payload: Uint8Array): Promise<Uint8Array> | Uint8Array;
    lineage?: readonly string[];
}

Source: @openagentid/claude-agent@0.1.1, dist/types-BH6j5Zy9.d.ts:12.

ScopeDecision

Result of a credential / scope check.

Type-only declaration; it is not a runtime value.

Signature
interface ScopeDecision {
    allowed: boolean;
    matchedScope?: string;
    reason?: string;
}

Source: @openagentid/claude-agent@0.1.1, dist/types-BH6j5Zy9.d.ts:32.

SkillDecision

Result of a skills policy evaluation.

Type-only declaration; it is not a runtime value.

Signature
interface SkillDecision {
    allowed: boolean;
    reason?: string;
    matchedScope?: string;
}

Source: @openagentid/claude-agent@0.1.1, dist/types-BH6j5Zy9.d.ts:113.

SkillEvaluationContext

Context passed to a skills policy evaluation.

Type-only declaration; it is not a runtime value.

Signature
interface SkillEvaluationContext {
    identity: OpenAgentIdentity;
    capabilities: CapabilityChecker;
    metadata?: Record<string, unknown>;
}

Source: @openagentid/claude-agent@0.1.1, dist/types-BH6j5Zy9.d.ts:104.

SkillsPolicy

Skills policy: decides whether a SKILLS.md skill may be invoked.

Type-only declaration; it is not a runtime value.

Signature
interface SkillsPolicy {
    evaluate(skillName: string, ctx: SkillEvaluationContext): Promise<SkillDecision> | SkillDecision;
}

Source: @openagentid/claude-agent@0.1.1, dist/types-BH6j5Zy9.d.ts:94.

Package requirements

Peer dependencies

PackagePublished rangeOptional
@anthropic-ai/claude-agent-sdk&gt;=0.1.0No
@openagentid/sdk^0.1.0Yes

Archive verification

Pinned integrity:

SHA-512 integrity
sha512-kUX3T6aS6PYr0GqQmLG7t2DLeOquNBVAoDkXN1yk09ffh6S5TIuHQgA2jptxjgLetu4n3XXP0AmEFb+jgQ1Dow==

Machine-readable API manifest · Coverage

On this page