OpenAgentIDDocumentation
API referencenpm packages@openagentid/arsenal-sdk
OpenAgentIDAPI reference

@openagentid/arsenal-sdk/core

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

All packages · Runnable examples · Start an agent

ContractValue
Package@openagentid/arsenal-sdk@0.1.1
Entry point@openagentid/arsenal-sdk/core
AvailabilityPublished package
Reference sourcePublished TypeScript declarations
Package enginesnode >=20

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/core/index.d.ts
import./dist/core/index.js
require./dist/core/index.cjs

Exports

addPolicyRule

Append a rule to a policy, returning a new document.

Signature
declare function addPolicyRule(doc: PolicyDocument, rule: PolicyRule): PolicyDocument;

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:112.

AgentCapabilityToken

Immutable Agent Capability Token. Wraps a set of claims and an optional signature, and provides validation + CBOR (de)serialization.

Signature
declare class AgentCapabilityToken {
    readonly claims: TokenClaims;
    readonly signature: TokenSignature | undefined;
    static fromClaims(claims: TokenClaims): AgentCapabilityToken;
    static fromClaimsAndSignature(claims: TokenClaims, signature: TokenSignature): AgentCapabilityToken;
    get id(): string;
    get subject(): string;
    get audience(): string;
    get scopes(): ScopeSet;
    isExpired(now?: Date): boolean;
    isNotYetValid(now?: Date): boolean;
    isTimeValid(now?: Date): boolean;
    remainingTtlMs(now?: Date): number;
    isSigned(): boolean;
    validateStructure(now?: Date): void;
    toCbor(): Uint8Array;
    claimsToCbor(): Uint8Array;
    toBase64Url(): string;
    static fromCbor(bytes: Uint8Array): AgentCapabilityToken;
    static fromBase64Url(s: string): AgentCapabilityToken;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:75.

AgentId

Agent identifier (UUID v4).

Signature
declare class AgentId {
    static fromUuid(uuid: string): AgentId;
    static generate(): AgentId;
    asUuid(): string;
    toString(): string;
    toJSON(): string;
    equals(other: AgentId): boolean;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:184.

AgentIdentity

Signature
declare class AgentIdentity {
    static create(tenantId: TenantId, name: string, publicKeyFingerprint: KeyFingerprint): AgentIdentity;
    get id(): AgentId;
    get publicKeyFingerprint(): KeyFingerprint;
    get tenantId(): TenantId;
    get name(): string;
    get isActive(): boolean;
    get tags(): readonly string[];
    isValid(now?: Date): boolean;
    deactivate(): AgentIdentity;
    withExpiresAt(expiresAt: Date): AgentIdentity;
    withTag(tag: string): AgentIdentity;
    toJSON(): {
        id: string;
        public_key_fingerprint: string;
        tenant_id: string;
        name: string;
        created_at: string;
        expires_at: string | null;
        is_active: boolean;
        tags: readonly string[];
    };
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:237.

AgentIdentityData

Agent identity — the public cryptographic identity of an agent.

Contains only public key material — the private key is never stored.

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

Signature
interface AgentIdentityData {
    id: AgentId;
    publicKeyFingerprint: KeyFingerprint;
    tenantId: TenantId;
    name: string;
    createdAt: string;
    expiresAt: string | null;
    isActive: boolean;
    tags: readonly string[];
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:227.

allowDelegation

Allow up to depth levels of delegation to any agent.

Signature
declare function allowDelegation(depth: number): DelegationConstraints;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:392.

ArsenalError

Main error type for ARSENAL operations.

Extends the native Error class so it interoperates with standard JS error handling while carrying structured code/correlation/context fields.

Signature
declare class ArsenalError extends Error {
    readonly name = "ArsenalError";
    readonly code: number;
    readonly correlationId: string | undefined;
    readonly context: ErrorContext | undefined;
    constructor(code: number, message: string, options?: {
        correlationId?: string;
        context?: ErrorContext;
        cause?: unknown;
    });
    toString(): string;
    toJSON(): {
        code: number;
        message: string;
        correlation_id?: string;
        context?: ErrorContext;
    };
    withCorrelationId(id: string): ArsenalError;
    withContext(context: ErrorContext): ArsenalError;
    static authenticationFailed(): ArsenalError;
    static tokenExpired(): ArsenalError;
    static tokenSignatureInvalid(): ArsenalError;
    static tokenRevoked(): ArsenalError;
    static scopeExceeded(): ArsenalError;
    static insufficientPermissions(requiredScope: string): ArsenalError;
    static policyDenied(policyId: string): ArsenalError;
    static rateLimitExceeded(retryAfterSecs?: number): ArsenalError;
    static secretNotFound(): ArsenalError;
    static validationFailed(field: string, reason: string): ArsenalError;
    static internal(): ArsenalError;
    static sessionExpired(): ArsenalError;
    static proxyDestinationViolation(domain: string): ArsenalError;
    static ssrfBlocked(): ArsenalError;
    static templateVariableNotFound(variable: string): ArsenalError;
    static invalidTemplateVariable(name: string): ArsenalError;
    static consentRequired(): ArsenalError;
    static consentDenied(): ArsenalError;
    static fingerprintMismatch(): ArsenalError;
    static configurationError(component: string): ArsenalError;
    static cryptoOperationFailed(): ArsenalError;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:104.

AuditEvent

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

Signature
interface AuditEvent {
    id: string;
    timestamp: string;
    kind: AuditEventKindValue;
    severity: AuditSeverityValue;
    tenant_id: string;
    agent_id?: string;
    session_id?: string;
    token_id?: string;
    outcome: AuditOutcomeValue;
    description: string;
    metadata: Readonly<Record<string, unknown>>;
    client_ip?: string;
    user_agent?: string;
    request_id?: string;
    previous_hash?: Uint8Array;
    event_hash?: Uint8Array;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:485.

AuditEventKind

Kind of audit event.

Signature
declare const AuditEventKind: {
    readonly AgentAuthenticated: "agent_authenticated";
    readonly AuthenticationFailed: "authentication_failed";
    readonly SessionStarted: "session_started";
    readonly SessionEnded: "session_ended";
    readonly CapabilityRequested: "capability_requested";
    readonly CapabilityGranted: "capability_granted";
    readonly CapabilityDenied: "capability_denied";
    readonly TokenRevoked: "token_revoked";
    readonly SecretRead: "secret_read";
    readonly SecretRotated: "secret_rotated";
    readonly ProxyRequest: "proxy_request";
    readonly ProxyDenied: "proxy_denied";
    readonly ConsentRequested: "consent_requested";
    readonly ConsentApproved: "consent_approved";
    readonly ConsentDenied: "consent_denied";
    readonly ConsentRevoked: "consent_revoked";
    readonly PolicyEvaluated: "policy_evaluated";
    readonly PolicyViolation: "policy_violation";
    readonly ConfigChanged: "config_changed";
    readonly KeyRotated: "key_rotated";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:462.

AuditEventKindValue

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

Signature
type AuditEventKindValue = (typeof AuditEventKind)[keyof typeof AuditEventKind];

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:484.

AuditOutcome

Signature
declare const AuditOutcome: {
    readonly Success: "success";
    readonly Failure: "failure";
    readonly Partial: "partial";
    readonly Pending: "pending";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:454.

AuditOutcomeValue

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

Signature
type AuditOutcomeValue = (typeof AuditOutcome)[keyof typeof AuditOutcome];

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:460.

AuditSeverity

Audit event types. The hash chain integrity checks are performed by the broker, but the type shape is defined here for parity with arsenal_core::audit.

Signature
declare const AuditSeverity: {
    readonly Info: "info";
    readonly Warning: "warning";
    readonly Error: "error";
    readonly Critical: "critical";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:447.

AuditSeverityValue

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

Signature
type AuditSeverityValue = (typeof AuditSeverity)[keyof typeof AuditSeverity];

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:453.

base64Decode

Decode a base64 string (standard or URL alphabet, with or without padding).

Signature
declare function base64Decode(s: string): Uint8Array;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:534.

base64Encode

Encode bytes to base64 (standard alphabet, no padding).

Signature
declare function base64Encode(bytes: Uint8Array): string;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:530.

base64UrlDecode

Decode a base64url string. Same as base64Decode for convenience.

Signature
declare function base64UrlDecode(s: string): Uint8Array;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:536.

base64UrlEncode

Encode bytes to base64url (URL-safe alphabet, no padding).

Signature
declare function base64UrlEncode(bytes: Uint8Array): string;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:532.

BindingType

Constraints that bind ACTs to specific contexts.

Tokens can be restricted to a specific device, session, origin, IP range, time window, or environment. Constraints are evaluated at the broker and at the proxy boundary.

Signature
declare const BindingType: {
    readonly Required: "required";
    readonly Preferred: "preferred";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:8.

BindingTypeValue

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

Signature
type BindingTypeValue = (typeof BindingType)[keyof typeof BindingType];

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:12.

buildTokenClaims

Validate and build a fresh set of token claims.

Signature
declare function buildTokenClaims(opts: TokenClaimsBuildOptions): TokenClaims;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:70.

canDelegateTo

Check whether a delegation to the given agent id is permitted.

Signature
declare function canDelegateTo(constraints: DelegationConstraints, agentId: string): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:394.

canTransitionTo

Signature
declare function canTransitionTo(from: SessionStateValue, to: SessionStateValue): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:427.

CompositeRateLimiter

Composite rate limiter combining multiple time windows + concurrent cap.

Use acquire() which returns a release function — call it when the request completes (e.g. in a finally) to decrement the concurrent counter. If any individual limit rejects, already-consumed slots are rolled back.

Signature
declare class CompositeRateLimiter {
    constructor(limits: RateLimits);
    acquire(): () => void;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:175.

ConditionOperator

Signature
declare const ConditionOperator: {
    readonly Equals: "equals";
    readonly NotEquals: "not_equals";
    readonly Contains: "contains";
    readonly StartsWith: "starts_with";
    readonly EndsWith: "ends_with";
    readonly Matches: "matches";
    readonly In: "in";
    readonly NotIn: "not_in";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:25.

ConditionOperatorValue

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

Signature
type ConditionOperatorValue = (typeof ConditionOperator)[keyof typeof ConditionOperator];

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:35.

ConsentPolicy

Signature
declare const ConsentPolicy: {
    readonly PerVariable: "per_variable";
    readonly PerProvider: "per_provider";
    readonly PerAgent: "per_agent";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:118.

ConsentPolicyValue

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

Signature
type ConsentPolicyValue = (typeof ConsentPolicy)[keyof typeof ConsentPolicy];

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:123.

ConsentRecord

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

Signature
interface ConsentRecord {
    consent_id: string;
    tenant_id: string;
    agent_did: string;
    human_root_did: string;
    variables: readonly string[];
    destination_domains: readonly string[];
    scopes: readonly string[];
    granted_by: string;
    granted_at: string;
    expires_at: string;
    signature: Uint8Array;
    revocable: boolean;
    revoked: boolean;
    revoked_at?: string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:124.

consentRecordCoversDomain

Returns true if the record covers the given destination domain (case-insensitive).

Signature
declare function consentRecordCoversDomain(record: ConsentRecord, domain: string): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:146.

consentRecordCoversVariable

Returns true if the record covers the given variable name.

Signature
declare function consentRecordCoversVariable(record: ConsentRecord, variable: string): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:144.

consentRecordIsValid

Validity check (not revoked and not expired).

Signature
declare function consentRecordIsValid(record: ConsentRecord, now?: Date): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:142.

consentRecordSigningBytes

Canonical CBOR encoding of the signable subset (excludes signature, revoked, revoked_at). This is the byte sequence a human root key signs with Ed25519 to produce record.signature.

Signature
declare function consentRecordSigningBytes(record: ConsentRecord): Uint8Array;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:154.

ConsentRequest

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

Signature
interface ConsentRequest {
    request_id: string;
    agent_did: string;
    human_root_did: string;
    variables: readonly string[];
    destination_domains: readonly string[];
    scopes: readonly string[];
    created_at: string;
    expires_at: string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:155.

consentRequestIsExpired

Signature
declare function consentRequestIsExpired(req: ConsentRequest, now?: Date): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:174.

ConsentStatus

Consent protocol types for human-in-the-loop credential authorization.

Signature
declare const ConsentStatus: {
    readonly PreApproved: "pre_approved";
    readonly Approved: "approved";
    readonly Pending: "pending";
    readonly Denied: "denied";
    readonly Revoked: "revoked";
    readonly NotRequired: "not_required";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:108.

consentStatusAllowsOperation

Signature
declare function consentStatusAllowsOperation(status: ConsentStatusValue): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:117.

ConsentStatusValue

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

Signature
type ConsentStatusValue = (typeof ConsentStatus)[keyof typeof ConsentStatus];

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:116.

ConstraintContext

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

Signature
interface ConstraintContext {
    current_time: Date;
    device_id?: string;
    session_id?: string;
    session_key_hash?: Uint8Array;
    origin?: string;
    client_ip?: string;
    environment?: string;
    tags: ReadonlySet<string>;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:50.

Constraints

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

Signature
interface Constraints {
    device_binding?: DeviceBinding;
    session_binding?: SessionBinding;
    origin_binding?: OriginBinding;
    network_constraints?: NetworkConstraints;
    time_constraints?: TimeConstraints;
    environment_constraints?: EnvironmentConstraint;
    require_pop: boolean;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:41.

contextNow

Create a fresh ConstraintContext with current_time=now().

Signature
declare function contextNow(): ConstraintContext;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:71.

createAuditEvent

Create a new audit event.

Signature
declare function createAuditEvent(opts: {
    kind: AuditEventKindValue;
    tenant_id: string;
    severity?: AuditSeverityValue;
    outcome?: AuditOutcomeValue;
    description?: string;
    metadata?: Record<string, unknown>;
    agent_id?: string;
    session_id?: string;
    token_id?: string;
    client_ip?: string;
    user_agent?: string;
    request_id?: string;
}): AuditEvent;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:504.

createConsentRequest

Create a new consent request with validation.

Signature
declare function createConsentRequest(opts: {
    agent_did: string;
    human_root_did: string;
    variables: readonly string[];
    destination_domains: readonly string[];
    scopes: readonly string[];
    ttl_seconds?: number;
}): ConsentRequest;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:166.

createDestinationBinding

Create and validate a destination binding.

Signature
declare function createDestinationBinding(allowedDomains: readonly string[], opts?: Partial<Omit<DestinationBinding, "allowed_domains">>): DestinationBinding;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:205.

createPolicyDocument

Build a new policy document (no rules yet).

Signature
declare function createPolicyDocument(tenantId: string, name: string): PolicyDocument;

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:110.

createPolicyRequest

Create a new policy request with current timestamp.

Signature
declare function createPolicyRequest(agentId: string, tenantId: string, requestedScope: string): PolicyRequest;

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:123.

createPolicyRule

Create a simple rule. Conditions are added via spread.

Signature
declare function createPolicyRule(id: string, effect: PolicyEffectValue, conditions?: readonly PolicyCondition[]): PolicyRule;

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:87.

createSecretMetadata

Create a new secret metadata record.

Signature
declare function createSecretMetadata(tenantId: string, name: string, secretType: SecretTypeValue): SecretMetadata;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:340.

createTemplateVariable

Create a template variable, validating the name.

Signature
declare function createTemplateVariable(name: string): TemplateVariable;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:219.

decisionIsAllowed

Returns true if the decision allows the action.

Signature
declare function decisionIsAllowed(d: PolicyDecision): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:130.

decisionIsDenied

Returns true if the decision denies the action.

Signature
declare function decisionIsDenied(d: PolicyDecision): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:132.

decodeCbor

Decode a CBOR byte string into a plain JS value.

Signature
declare function decodeCbor(bytes: Uint8Array): unknown;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:566.

defaultRateLimits

Default moderate rate limits (same as Rust RateLimits::default()).

Signature
declare function defaultRateLimits(): RateLimits;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:95.

defaultUsageBudget

Signature
declare function defaultUsageBudget(): UsageBudget;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:109.

DelegationConstraints

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

Signature
interface DelegationConstraints {
    allow_delegation: boolean;
    max_depth: number;
    delegatable_scopes?: ScopeSet;
    allowed_delegates: readonly string[];
    allow_any_delegate: boolean;
    min_ttl_reduction: number;
    require_approval: boolean;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:379.

denyDelegation

Default: delegation denied.

Signature
declare function denyDelegation(): DelegationConstraints;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:390.

DestinationBinding

Destination binding restricting which endpoints a credential can reach.

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

Signature
interface DestinationBinding {
    allowed_domains: readonly string[];
    allowed_paths?: readonly string[];
    allowed_methods?: readonly string[];
    allowed_ports?: readonly number[];
    require_tls: boolean;
    allow_subdomains: boolean;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:196.

DeviceBinding

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

Signature
interface DeviceBinding {
    device_id: string;
    binding_type: BindingTypeValue;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:13.

DeviceId

Device identifier for device binding.

Signature
declare class DeviceId {
    static parse(id: string): DeviceId;
    asString(): string;
    toString(): string;
    toJSON(): string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:195.

effectiveTimeoutMs

Resolve the effective timeout, capped to MAX_TIMEOUT_MS.

Signature
declare function effectiveTimeoutMs(req: ProxyRequest): number;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:240.

encodeCbor

Encode a value to deterministic CBOR bytes.

Signature
declare function encodeCbor(value: unknown): Uint8Array;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:564.

EnvironmentConstraint

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

Signature
interface EnvironmentConstraint {
    required_environment?: string;
    required_tags?: ReadonlySet<string>;
    forbidden_tags?: ReadonlySet<string>;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:36.

ErrorCode

Error codes for programmatic handling. Numeric values match the Rust crate arsenal_core::error::ErrorCode so wire-level cross-language parity holds.

Signature
declare const ErrorCode: {
    readonly AuthenticationFailed: 1001;
    readonly TokenExpired: 1002;
    readonly TokenSignatureInvalid: 1003;
    readonly PopVerificationFailed: 1004;
    readonly IdentityInvalid: 1005;
    readonly SessionExpired: 1006;
    readonly InsufficientPermissions: 2001;
    readonly ScopeExceeded: 2002;
    readonly PolicyDenied: 2003;
    readonly DelegationInvalid: 2004;
    readonly RateLimitExceeded: 2005;
    readonly BudgetExhausted: 2006;
    readonly TimeConstraintViolation: 3001;
    readonly EnvironmentBindingViolation: 3002;
    readonly NetworkConstraintViolation: 3003;
    readonly DeviceBindingViolation: 3004;
    readonly OriginBindingViolation: 3005;
    readonly SecretNotFound: 4001;
    readonly SecretVersionNotFound: 4002;
    readonly SecretRevoked: 4003;
    readonly SecretRotationInProgress: 4004;
    readonly SecretUnwrapLimitExceeded: 4005;
    readonly CryptoOperationFailed: 4006;
    readonly ValidationFailed: 5001;
    readonly MalformedRequest: 5002;
    readonly InvalidTokenFormat: 5003;
    readonly InvalidScopeFormat: 5004;
    readonly InvalidConstraint: 5005;
    readonly InternalError: 6001;
    readonly StorageError: 6002;
    readonly ConfigurationError: 6003;
    readonly CryptoSubsystemError: 6004;
    readonly AuditError: 6005;
    readonly SerializationFailed: 6006;
    readonly TokenRevoked: 7001;
    readonly AgentDeactivated: 7002;
    readonly TenantSuspended: 7003;
    readonly RevocationStatusUnknown: 7004;
    readonly ProxyDestinationViolation: 8001;
    readonly ProxyRequestFailed: 8002;
    readonly ProxyTimeout: 8003;
    readonly SsrfBlocked: 8004;
    readonly TemplateVariableNotFound: 8005;
    readonly TemplateVariableAccessDenied: 8006;
    readonly InvalidTemplateVariable: 8007;
    readonly OAuthReauthRequired: 8008;
    readonly ConsentRequired: 9001;
    readonly ConsentDenied: 9002;
    readonly ConsentExpired: 9003;
    readonly ConsentRevoked: 9004;
    readonly FingerprintMismatch: 10001;
    readonly FingerprintStateNotFound: 10002;
    readonly DctScopeAmplification: 11001;
    readonly DctDepthExceeded: 11002;
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:19.

ErrorCodeValue

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

Signature
type ErrorCodeValue = (typeof ErrorCode)[keyof typeof ErrorCode];

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:75.

ErrorContext

Additional structured context attached to an ArsenalError. All fields are sanitized — never include raw secrets or internal paths.

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

Signature
interface ErrorContext {
    operation?: string;
    resource?: string;
    constraint?: string;
    timestamp?: string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:92.

extractProxyRequestVariables

Extract all template variables used anywhere in a proxy request.

Signature
declare function extractProxyRequestVariables(req: ProxyRequest): readonly TemplateVariable[];

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:242.

hashAuditEvent

Compute a BLAKE3 hash of an audit event. The hash is used for chain linkage and tamper detection. The result is a 32-byte Uint8Array.

Signature
declare function hashAuditEvent(event: AuditEvent): Promise<Uint8Array>;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:522.

hexDecode

Decode a hex string into bytes. Throws on invalid input.

Signature
declare function hexDecode(s: string): Uint8Array;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:540.

hexEncode

Encode bytes as lowercase hex.

Signature
declare function hexEncode(bytes: Uint8Array): string;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:538.

inferVariablePrefix

Infer the credential-type prefix from a variable name.

Signature
declare function inferVariablePrefix(name: string): VariablePrefixValue;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:222.

ipInCidrRange

Check if a dotted-quad or IPv6 address falls inside a CIDR range. Supports both IPv4 and IPv6. Invalid CIDR or IP input returns false.

Signature
declare function ipInCidrRange(ip: string, cidr: string): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:81.

isClientError

Returns true if the error code falls into the 1000..5999 client-error range.

Signature
declare function isClientError(code: number): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:77.

isConsentError

Returns true if the error code falls into the 9000..9999 consent error range.

Signature
declare function isConsentError(code: number): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:83.

isDomainAllowed

Check if a domain is allowed by the binding.

Signature
declare function isDomainAllowed(binding: DestinationBinding, domain: string): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:209.

isFingerprintError

Returns true if the error code falls into the 10000..10999 fingerprint range.

Signature
declare function isFingerprintError(code: number): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:85.

isMethodAllowed

Signature
declare function isMethodAllowed(binding: DestinationBinding, method: string): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:210.

isPathAllowed

Signature
declare function isPathAllowed(binding: DestinationBinding, path: string): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:212.

isPermanentError

Returns true if the error is permanent (retry will not help).

Signature
declare function isPermanentError(code: number): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:87.

isPortAllowed

Signature
declare function isPortAllowed(binding: DestinationBinding, port: number): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:211.

isProxyError

Returns true if the error code falls into the 8000..8999 proxy error range.

Signature
declare function isProxyError(code: number): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:81.

isServerError

Returns true if the error code falls into the 6000..6999 server-error range.

Signature
declare function isServerError(code: number): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:79.

KeyFingerprint

Public-key fingerprint — BLAKE3 hash (32 bytes) of a public key.

Uses a constant-time compare for equality checks.

Signature
declare class KeyFingerprint {
    static fromBytes(bytes: Uint8Array): KeyFingerprint;
    static fromPublicKey(publicKey: Uint8Array): Promise<KeyFingerprint>;
    static fromHex(hex: string): KeyFingerprint;
    asBytes(): Uint8Array;
    toHex(): string;
    toString(): string;
    constantTimeEquals(other: KeyFingerprint): boolean;
    toJSON(): string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:208.

latestSecretRef

Reference to the latest version.

Signature
declare function latestSecretRef(id: string): SecretRef;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:347.

MAX_CHAIN_LENGTH

Maximum number of tokens in a delegation chain.

Signature
declare const MAX_CHAIN_LENGTH = 10;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:378.

MAX_CONDITION_DEPTH

Maximum recursion depth for nested And/Or/Not conditions.

Signature
declare const MAX_CONDITION_DEPTH = 16;

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:10.

MAX_DELEGATION_DEPTH

Maximum absolute delegation depth allowed anywhere in the system.

Signature
declare const MAX_DELEGATION_DEPTH = 5;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:376.

mergeRateLimits

Merge two limit configs taking the more restrictive (minimum) value.

Signature
declare function mergeRateLimits(a: RateLimits, b: RateLimits): RateLimits;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:101.

mergeUsageBudget

Signature
declare function mergeUsageBudget(a: UsageBudget, b: UsageBudget): UsageBudget;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:112.

minimalUsageBudget

Signature
declare function minimalUsageBudget(): UsageBudget;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:111.

NetworkConstraints

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

Signature
interface NetworkConstraints {
    allowed_ips?: ReadonlySet<string>;
    denied_ips?: ReadonlySet<string>;
    allowed_cidrs?: readonly string[];
    allowed_asns?: ReadonlySet<number>;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:24.

noConstraints

Build an empty constraint object (no restrictions).

Signature
declare function noConstraints(): Constraints;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:61.

OriginBinding

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

Signature
interface OriginBinding {
    allowed_origins: ReadonlySet<string>;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:21.

parsePermission

Parse a string into a Permission value. Throws on unknown input.

Signature
declare function parsePermission(s: string): PermissionValue;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:266.

parseTemplateVariables

Parse all &#123;&#123;VARIABLE&#125;&#125; placeholders from a string. Invalid names inside &#123;&#123;&#125;&#125; are silently skipped. Duplicates are deduplicated.

Signature
declare function parseTemplateVariables(input: string): readonly TemplateVariable[];

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:227.

Permission

CRUD permission classification.

Signature
declare const Permission: {
    readonly Read: "read";
    readonly Create: "create";
    readonly Update: "update";
    readonly Delete: "delete";
    readonly Admin: "admin";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:255.

permissionImplies

Check if permission a implies permission b.

Signature
declare function permissionImplies(a: PermissionValue, b: PermissionValue): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:264.

PermissionValue

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

Signature
type PermissionValue = (typeof Permission)[keyof typeof Permission];

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:262.

PolicyCondition

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

Signature
type PolicyCondition = {
    type: "agent_id";
    operator: ConditionOperatorValue;
    value: string;
} | {
    type: "tenant_id";
    operator: ConditionOperatorValue;
    value: string;
} | {
    type: "scope";
    operator: ConditionOperatorValue;
    value: string;
} | {
    type: "environment";
    operator: ConditionOperatorValue;
    value: string;
} | {
    type: "time_of_day";
    allowed_hours: readonly number[];
} | {
    type: "day_of_week";
    allowed_days: readonly number[];
} | {
    type: "ip_address";
    allowed_cidrs: readonly string[];
} | {
    type: "attribute";
    key: string;
    operator: ConditionOperatorValue;
    value: string;
} | {
    type: "and";
    conditions: readonly PolicyCondition[];
} | {
    type: "or";
    conditions: readonly PolicyCondition[];
} | {
    type: "not";
    condition: PolicyCondition;
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:36.

PolicyDecision

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

Signature
interface PolicyDecision {
    effect: PolicyEffectValue;
    matched_rule?: string;
    reason?: string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:124.

PolicyDocument

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

Signature
interface PolicyDocument {
    id: string;
    version: number;
    tenant_id: string;
    name: string;
    description?: string;
    rules: readonly PolicyRule[];
    default_effect: PolicyEffectValue;
    is_active: boolean;
    priority: number;
    created_at: string;
    updated_at: string;
    signature?: PolicySignature;
    labels: Readonly<Record<string, string>>;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:94.

PolicyEffect

Signature
declare const PolicyEffect: {
    readonly Allow: "allow";
    readonly Deny: "deny";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:20.

PolicyEffectValue

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

Signature
type PolicyEffectValue = (typeof PolicyEffect)[keyof typeof PolicyEffect];

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:24.

PolicyId

Signature
declare class PolicyId {
    static parse(id: string): PolicyId;
    static generate(): PolicyId;
    asString(): string;
    toString(): string;
    toJSON(): string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:11.

PolicyRequest

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

Signature
interface PolicyRequest {
    agent_id: string;
    tenant_id: string;
    requested_scope: string;
    timestamp: Date;
    environment?: string;
    client_ip?: string;
    attributes: Readonly<Record<string, string>>;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:113.

PolicyRule

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

Signature
interface PolicyRule {
    id: string;
    description?: string;
    effect: PolicyEffectValue;
    conditions: readonly PolicyCondition[];
    scopes?: ScopeSet;
    constraints?: Constraints;
    rate_limits?: RateLimits;
    budget?: UsageBudget;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:76.

PolicySignature

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

Signature
interface PolicySignature {
    bytes: Uint8Array;
    algorithm: string;
    key_id: string;
    signed_at: string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/policy-C-EX1HGX.d.ts:88.

PrincipalId

Principal identifier — user, service account, or system principal.

Signature
declare class PrincipalId {
    static parse(id: string): PrincipalId;
    static generate(): PrincipalId;
    static system(): PrincipalId;
    isSystem(): boolean;
    asString(): string;
    toString(): string;
    toJSON(): string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:172.

ProofOfPossession

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

Signature
interface ProofOfPossession {
    key_fingerprint: string;
    alg: string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:23.

ProxyMetadata

Metadata about proxy processing (never includes resolved values).

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

Signature
interface ProxyMetadata {
    variables_resolved: readonly string[];
    destination_verified: boolean;
    fingerprint_verified: boolean;
    consent_status: ConsentStatusValue;
    latency_ms: number;
    request_id: string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:251.

ProxyRequest

Proxy request envelope sent to the broker.

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

Signature
interface ProxyRequest {
    method: string;
    url: string;
    headers?: Readonly<Record<string, string>>;
    body?: Uint8Array;
    capability_token: string;
    timeout_ms?: number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:229.

ProxyResponse

Response from a proxy request.

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

Signature
interface ProxyResponse {
    status: number;
    headers: Readonly<Record<string, string>>;
    body: Uint8Array;
    proxy_metadata: ProxyMetadata;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:244.

RateLimits

Rate limits, usage budgets, and runtime tracking primitives.

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

Signature
interface RateLimits {
    requests_per_second?: number;
    requests_per_minute?: number;
    requests_per_hour?: number;
    max_concurrent?: number;
    max_request_size?: number;
    max_response_size?: number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:86.

RemainingBudget

Remaining budget (undefined entries are unlimited).

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

Signature
interface RemainingBudget {
    requests?: number;
    bytes?: number;
    cost_units?: number;
    secret_unwraps?: number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:122.

revokeConsentRecord

Return a revoked copy of the consent record.

Signature
declare function revokeConsentRecord(record: ConsentRecord, at?: Date): ConsentRecord;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:148.

sanitizeFieldName

Strip unsafe characters from a field name.

Signature
declare function sanitizeFieldName(field: string): string;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:152.

sanitizeResourceId

Strip path-traversal characters and cap length.

Signature
declare function sanitizeResourceId(id: string): string;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:148.

sanitizeScope

Strip unsafe characters from a scope; keep separators.

Signature
declare function sanitizeScope(scope: string): string;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:150.

Scope

A single permission scope.

Signature
declare class Scope {
    static parse(scope: string): Scope;
    static wildcard(): Scope;
    static readOnly(service: string): Scope;
    static fullAccess(service: string): Scope;
    get service(): string;
    get resource(): string;
    get action(): string;
    isWildcard(): boolean;
    implies(other: Scope): boolean;
    asString(): string;
    toString(): string;
    toJSON(): string;
    equals(other: Scope): boolean;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:200.

ScopeSet

A set of scopes, maintained as a sorted list for deterministic encoding.

Signature
declare class ScopeSet {
    static empty(): ScopeSet;
    static single(scope: Scope): ScopeSet;
    static fromStrings(scopes: readonly string[]): ScopeSet;
    static fromScopes(scopes: readonly Scope[]): ScopeSet;
    add(scope: Scope): ScopeSet;
    remove(scope: Scope): ScopeSet;
    contains(scope: Scope): boolean;
    allows(requested: Scope): boolean;
    isSupersetOf(other: ScopeSet): boolean;
    intersection(other: ScopeSet): ScopeSet;
    union(other: ScopeSet): ScopeSet;
    get length(): number;
    isEmpty(): boolean;
    toArray(): readonly Scope[];
    toStrings(): readonly string[];
    [Symbol.iterator](): Iterator<Scope>;
    toJSON(): readonly string[];
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:228.

SecretId

Secret identifier.

Signature
declare class SecretId {
    static generate(): SecretId;
    static fromString(id: string): SecretId;
    asString(): string;
    toString(): string;
    toJSON(): string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:275.

SecretMetadata

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

Signature
interface SecretMetadata {
    id: string;
    tenant_id: string;
    name: string;
    description?: string;
    secret_type: SecretTypeValue;
    current_version: number;
    versions: readonly SecretVersionInfo[];
    created_at: string;
    updated_at: string;
    expires_at?: string;
    last_rotated_at?: string;
    next_rotation_at?: string;
    is_active: boolean;
    labels: Readonly<Record<string, string>>;
    service?: string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:322.

SecretRef

Reference to a secret — used when the value shouldn't be inlined.

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

Signature
interface SecretRef {
    id: string;
    version?: number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:342.

SecretType

Signature
declare const SecretType: {
    readonly ApiKey: "api_key";
    readonly OAuthClientCredentials: "o_auth_client_credentials";
    readonly OAuthAccessToken: "o_auth_access_token";
    readonly OAuthRefreshToken: "o_auth_refresh_token";
    readonly DatabaseCredentials: "database_credentials";
    readonly SshKey: "ssh_key";
    readonly TlsCertificate: "tls_certificate";
    readonly SigningKey: "signing_key";
    readonly EncryptionKey: "encryption_key";
    readonly Generic: "generic";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:296.

SecretTypeValue

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

Signature
type SecretTypeValue = (typeof SecretType)[keyof typeof SecretType];

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:308.

SecretValue

Secret value holder that clears its internal buffer when zeroize() is called. JS has no destructors, so callers must explicitly invoke zeroize() in a finally block after use.

Signature
declare class SecretValue {
    static fromBytes(bytes: Uint8Array): SecretValue;
    static fromString(s: string): SecretValue;
    asBytes(): Uint8Array;
    asString(): string;
    get length(): number;
    isEmpty(): boolean;
    zeroize(): void;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:355.

SecretVersion

Secret version number (1-based).

Signature
declare class SecretVersion {
    static initial(): SecretVersion;
    static fromNumber(n: number): SecretVersion;
    asNumber(): number;
    next(): SecretVersion;
    isInitial(): boolean;
    toString(): string;
    toJSON(): number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:285.

SecretVersionInfo

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

Signature
interface SecretVersionInfo {
    version: number;
    created_at: string;
    created_by?: string;
    state: SecretVersionStateValue;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:316.

SecretVersionState

Signature
declare const SecretVersionState: {
    readonly Active: "active";
    readonly Previous: "previous";
    readonly Disabled: "disabled";
    readonly PendingDeletion: "pending_deletion";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:309.

SecretVersionStateValue

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

Signature
type SecretVersionStateValue = (typeof SecretVersionState)[keyof typeof SecretVersionState];

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:315.

SessionBinding

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

Signature
interface SessionBinding {
    session_id: string;
    session_key_hash?: Uint8Array;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:17.

SessionEndReason

Signature
declare const SessionEndReason: {
    readonly Completed: "completed";
    readonly Logout: "logout";
    readonly Timeout: "timeout";
    readonly TokenExpired: "token_expired";
    readonly Revoked: "revoked";
    readonly SecurityViolation: "security_violation";
    readonly PolicyViolation: "policy_violation";
    readonly SystemShutdown: "system_shutdown";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:428.

SessionEndReasonValue

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

Signature
type SessionEndReasonValue = (typeof SessionEndReason)[keyof typeof SessionEndReason] | {
    error: string;
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:438.

SessionId

Session identifier (UUID v7 in Rust; UUID v4 is acceptable here).

Signature
declare class SessionId {
    static generate(): SessionId;
    static fromString(s: string): SessionId;
    asString(): string;
    toString(): string;
    toJSON(): string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:402.

SessionState

Signature
declare const SessionState: {
    readonly AgentBootstrapped: "agent_bootstrapped";
    readonly SessionStarted: "session_started";
    readonly CapabilitiesGranted: "capabilities_granted";
    readonly ToolUse: "tool_use";
    readonly Renewal: "renewal";
    readonly Escalation: "escalation";
    readonly SessionEnded: "session_ended";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:411.

sessionStateCanRequestCapabilities

Signature
declare function sessionStateCanRequestCapabilities(state: SessionStateValue): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:422.

sessionStateCanUseTools

Signature
declare function sessionStateCanUseTools(state: SessionStateValue): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:421.

sessionStateIsActive

Signature
declare function sessionStateIsActive(state: SessionStateValue): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:424.

sessionStateIsTerminal

Signature
declare function sessionStateIsTerminal(state: SessionStateValue): boolean;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:423.

SessionStateValue

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

Signature
type SessionStateValue = (typeof SessionState)[keyof typeof SessionState];

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:420.

SignatureAlgorithm

Agent Capability Token (ACT) — the core credential type.

ACTs are short-lived (30s–24h), scoped, cryptographically-signed tokens that grant an agent specific capabilities. They are encoded as CBOR on the wire for deterministic signing, and base64url-encoded when sent over HTTP.

Signature
declare const SignatureAlgorithm: {
    readonly Ed25519: "ED25519";
    readonly Es256: "ES256";
    readonly Es384: "ES384";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:12.

SignatureAlgorithmValue

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

Signature
type SignatureAlgorithmValue = (typeof SignatureAlgorithm)[keyof typeof SignatureAlgorithm];

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:17.

specificSecretRef

Reference to a specific version.

Signature
declare function specificSecretRef(id: string, version: number): SecretRef;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:349.

strictRateLimits

Strict lockdown rate limits.

Signature
declare function strictRateLimits(): RateLimits;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:99.

TemplateVariable

Parsed template variable reference.

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

Signature
interface TemplateVariable {
    name: string;
    prefix: VariablePrefixValue;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:214.

TenantId

Tenant identifier — represents an organization or customer.

Signature
declare class TenantId {
    static parse(id: string): TenantId;
    static generate(): TenantId;
    asString(): string;
    toString(): string;
    toJSON(): string;
    equals(other: TenantId): boolean;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:161.

TimeConstraints

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

Signature
interface TimeConstraints {
    not_before?: string;
    not_after?: string;
    allowed_hours?: readonly number[];
    allowed_days?: readonly number[];
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:30.

TokenBucketLimiter

Token-bucket rate limiter. Lock-free single-threaded (JS single-threaded execution model) — refills on each try_acquire based on elapsed wall clock.

Signature
declare class TokenBucketLimiter {
    constructor(maxTokens: number, refillAmount: number, refillIntervalMs: number);
    static perSecond(rate: number): TokenBucketLimiter;
    static perMinute(rate: number): TokenBucketLimiter;
    static perHour(rate: number): TokenBucketLimiter;
    tryAcquire(): void;
    available(): number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:153.

TokenClaims

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

Signature
interface TokenClaims {
    jti: string;
    sub: string;
    iss: string;
    aud: string;
    iat: string;
    nbf: string;
    exp: string;
    tenant_id: string;
    scope: readonly string[];
    constraints?: Constraints;
    limits?: RateLimits;
    budget?: UsageBudget;
    trace?: TokenTrace;
    cnf?: ProofOfPossession;
    delegated_variables?: readonly string[];
    max_delegation_depth?: number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:35.

TokenClaimsBuildOptions

Options for building a fresh set of claims.

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

Signature
interface TokenClaimsBuildOptions {
    subject: string;
    issuer: string;
    audience: string;
    tenant_id: string;
    scopes: ScopeSet;
    ttl_seconds?: number;
    constraints?: Constraints;
    limits?: RateLimits;
    budget?: UsageBudget;
    parent_token_id?: string;
    cnf?: ProofOfPossession;
    delegated_variables?: readonly string[];
    max_delegation_depth?: number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:54.

TokenSignature

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

Signature
interface TokenSignature {
    bytes: Uint8Array;
    algorithm: SignatureAlgorithmValue;
    key_id?: string;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:18.

TokenTrace

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

Signature
interface TokenTrace {
    issuance_id: string;
    parent_token_id?: string;
    policy_id?: string;
    delegation_depth: number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:29.

unlimitedRateLimits

All unlimited — use with care.

Signature
declare function unlimitedRateLimits(): RateLimits;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:97.

unlimitedUsageBudget

Signature
declare function unlimitedUsageBudget(): UsageBudget;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:110.

UsageBudget

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

Signature
interface UsageBudget {
    max_requests?: number;
    max_bytes?: number;
    max_cost_units?: number;
    max_secret_unwraps?: number;
    max_delegation_depth?: number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:102.

UsageStats

Current usage snapshot.

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

Signature
interface UsageStats {
    request_count: number;
    bytes_transferred: number;
    cost_units: number;
    secret_unwraps: number;
    elapsed_ms: number;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:114.

UsageTracker

Runtime usage tracker that enforces a budget.

Each record* call either succeeds or throws an ArsenalError with code BudgetExhausted (or SecretUnwrapLimitExceeded).

Signature
declare class UsageTracker {
    constructor(budget: UsageBudget);
    recordRequest(): void;
    recordBytes(bytes: number): void;
    recordCost(units: number): void;
    recordSecretUnwrap(): void;
    getStats(): UsageStats;
    remaining(): RemainingBudget;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:134.

validateConstraints

Validate a set of constraints against a request context. Throws an ArsenalError on the first violation.

Signature
declare function validateConstraints(constraints: Constraints, ctx: ConstraintContext): void;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:76.

validateDelegationDepth

Validate a delegation chain length and scope non-amplification rule.

Signature
declare function validateDelegationDepth(depth: number): void;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:396.

validateDestinationBinding

Throws if the binding is malformed.

Signature
declare function validateDestinationBinding(binding: DestinationBinding): void;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:207.

validateProxyRequest

Validate structural fields of a proxy request.

Signature
declare function validateProxyRequest(req: ProxyRequest): void;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:238.

validateVariableName

Signature
declare function validateVariableName(name: string): void;

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:220.

validSessionStateTransitions

Returns the set of valid transitions from a given state.

Signature
declare function validSessionStateTransitions(state: SessionStateValue): readonly SessionStateValue[];

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:426.

VariablePrefix

Credential proxy protocol types.

These types describe the wire shape for proxy requests, destination bindings, and template-variable resolution. Agents construct ProxyRequest objects with &#123;&#123;VARIABLE&#125;&#125; placeholders; the broker resolves them server-side and never discloses raw credentials.

Signature
declare const VariablePrefix: {
    readonly OAuth2: "OAUTH2";
    readonly OAuth1: "OAUTH1";
    readonly ApiKey: "API_KEY";
    readonly Basic: "BASIC";
    readonly Bearer: "BEARER";
    readonly Cert: "CERT";
    readonly Custom: "CUSTOM";
};

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:185.

VariablePrefixValue

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

Signature
type VariablePrefixValue = (typeof VariablePrefix)[keyof typeof VariablePrefix];

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:194.

VariableResolutionTable

In-memory variable → secret-ref table used by the broker.

Signature
declare class VariableResolutionTable {
    register(variableName: string, secretRef: {
        id: string;
        version?: number;
    }): void;
    unregister(variableName: string): boolean;
    resolve(variableName: string): {
        id: string;
        version?: number;
    } | undefined;
    variableNames(): readonly string[];
    get size(): number;
    isEmpty(): boolean;
}

Source: @openagentid/arsenal-sdk@0.1.1, dist/proxy-DsVj9gLz.d.ts:260.

withDevice

Create constraints with a required device binding.

Signature
declare function withDevice(base: Constraints, deviceId: string): Constraints;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:65.

withOrigins

Create constraints with an allowed-origins binding.

Signature
declare function withOrigins(base: Constraints, origins: readonly string[]): Constraints;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:67.

withPop

Create constraints requiring proof-of-possession.

Signature
declare function withPop(): Constraints;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:63.

withTimeWindow

Create constraints with a time window.

Signature
declare function withTimeWindow(base: Constraints, notBefore: Date, notAfter: Date): Constraints;

Source: @openagentid/arsenal-sdk@0.1.1, dist/scope-CP8MvpbA.d.ts:69.

zeroize

Zeroize a Uint8Array in place. Use in finally blocks for secret buffers.

Signature
declare function zeroize(bytes: Uint8Array): void;

Source: @openagentid/arsenal-sdk@0.1.1, dist/core/index.d.ts:542.

Package requirements

Dependencies

PackagePublished range
uuid^11.0.3
zod^3.23.8

Peer dependencies

PackagePublished rangeOptional
@openagentid/crypto-wasm*Yes

Archive verification

Pinned integrity:

SHA-512 integrity
sha512-bqdIp1hFYeffqXDaTpq/JMJune81cNwrj23kaUl1OoXjp97Bf8kX47/EaOjCX7oLAbTk69SgD7q2p8nrMNeIeQ==

Machine-readable API manifest · Coverage

On this page

Import conditionsExportsaddPolicyRuleAgentCapabilityTokenAgentIdAgentIdentityAgentIdentityDataallowDelegationArsenalErrorAuditEventAuditEventKindAuditEventKindValueAuditOutcomeAuditOutcomeValueAuditSeverityAuditSeverityValuebase64Decodebase64Encodebase64UrlDecodebase64UrlEncodeBindingTypeBindingTypeValuebuildTokenClaimscanDelegateTocanTransitionToCompositeRateLimiterConditionOperatorConditionOperatorValueConsentPolicyConsentPolicyValueConsentRecordconsentRecordCoversDomainconsentRecordCoversVariableconsentRecordIsValidconsentRecordSigningBytesConsentRequestconsentRequestIsExpiredConsentStatusconsentStatusAllowsOperationConsentStatusValueConstraintContextConstraintscontextNowcreateAuditEventcreateConsentRequestcreateDestinationBindingcreatePolicyDocumentcreatePolicyRequestcreatePolicyRulecreateSecretMetadatacreateTemplateVariabledecisionIsAlloweddecisionIsDenieddecodeCbordefaultRateLimitsdefaultUsageBudgetDelegationConstraintsdenyDelegationDestinationBindingDeviceBindingDeviceIdeffectiveTimeoutMsencodeCborEnvironmentConstraintErrorCodeErrorCodeValueErrorContextextractProxyRequestVariableshashAuditEventhexDecodehexEncodeinferVariablePrefixipInCidrRangeisClientErrorisConsentErrorisDomainAllowedisFingerprintErrorisMethodAllowedisPathAllowedisPermanentErrorisPortAllowedisProxyErrorisServerErrorKeyFingerprintlatestSecretRefMAX_CHAIN_LENGTHMAX_CONDITION_DEPTHMAX_DELEGATION_DEPTHmergeRateLimitsmergeUsageBudgetminimalUsageBudgetNetworkConstraintsnoConstraintsOriginBindingparsePermissionparseTemplateVariablesPermissionpermissionImpliesPermissionValuePolicyConditionPolicyDecisionPolicyDocumentPolicyEffectPolicyEffectValuePolicyIdPolicyRequestPolicyRulePolicySignaturePrincipalIdProofOfPossessionProxyMetadataProxyRequestProxyResponseRateLimitsRemainingBudgetrevokeConsentRecordsanitizeFieldNamesanitizeResourceIdsanitizeScopeScopeScopeSetSecretIdSecretMetadataSecretRefSecretTypeSecretTypeValueSecretValueSecretVersionSecretVersionInfoSecretVersionStateSecretVersionStateValueSessionBindingSessionEndReasonSessionEndReasonValueSessionIdSessionStatesessionStateCanRequestCapabilitiessessionStateCanUseToolssessionStateIsActivesessionStateIsTerminalSessionStateValueSignatureAlgorithmSignatureAlgorithmValuespecificSecretRefstrictRateLimitsTemplateVariableTenantIdTimeConstraintsTokenBucketLimiterTokenClaimsTokenClaimsBuildOptionsTokenSignatureTokenTraceunlimitedRateLimitsunlimitedUsageBudgetUsageBudgetUsageStatsUsageTrackervalidateConstraintsvalidateDelegationDepthvalidateDestinationBindingvalidateProxyRequestvalidateVariableNamevalidSessionStateTransitionsVariablePrefixVariablePrefixValueVariableResolutionTablewithDevicewithOriginswithPopwithTimeWindowzeroizePackage requirementsDependenciesPeer dependenciesArchive verification