UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

42 lines (41 loc) • 2.92 kB
/** Closed compliance profile set (CC 2.1.221 policy-limits profiles). */ export type ComplianceProfile = "hipaa" | "zdr"; /** Closed capability set the ENGINE can veto end-to-end (see the module header for the entry-point * map — a capability is admitted here only with its full interception story). */ export type ComplianceCapability = "mcp_servers" | "workflows" | "web_fetch" | "org_memory_mount"; /** Every member of {@link ComplianceCapability} — the fail-closed "deny everything managed" set used * when the posture resolver itself fails. `satisfies` keeps it in lockstep with the union. */ export declare const COMPLIANCE_CAPABILITIES: readonly ["mcp_servers", "workflows", "web_fetch", "org_memory_mount"]; /** * A principal's resolved compliance posture, supplied by the trusted deployment resolver. The * effective deny set is `BUILTIN_COMPLIANCE_DENIES[profile] ∪ additionalDenies` — supply can only * TIGHTEN a profile's builtin floor, never carve a builtin deny back out. */ export interface CompliancePosture { profile: ComplianceProfile; /** Extra denies on top of the profile's builtin floor (closed set; unknown values are refused). */ additionalDenies?: readonly ComplianceCapability[]; } /** * Builtin per-profile deny floors, mapped from the CC 2.1.221 policy-limits pair table onto the * capabilities this engine manages: hipaa denies `allow_web_fetch` ⇒ `web_fetch`. (CC's * `allow_memory_sync` row maps onto the org-memory plane and joins this table together with the * memory-admission seam; CC has no MCP/workflow rows — those stay reachable via `additionalDenies`.) */ export declare const BUILTIN_COMPLIANCE_DENIES: Record<ComplianceProfile, readonly ComplianceCapability[]>; /** * Resolve a posture into its effective deny set. Fail-loud on any value outside the closed sets * (`config.compliance_posture`): a posture that does not parse must be treated by the caller as a * resolver FAULT (deny every managed capability), never as a partially-applied profile. */ export declare function resolveComplianceDenies(posture: CompliancePosture): ReadonlySet<ComplianceCapability>; /** The core web-fetch tool face's canonical mounted name (`createWebFetchTool` in tools/web.ts). */ export declare const WEB_FETCH_TOOL_NAME = "WebFetch"; /** * The CALL-TIME half of the `web_fetch` double point (CC form — mount check + call guard): given the * run's frozen deny set and a tool-call name, return the refusal text when the call must be blocked, * else `undefined`. Kept as a pure exported decision so the gate wiring and the tests hold ONE * predicate; today every roster lane that can mint a `WebFetch`-named tool is already refused at * prepare, so this is the standing second lock for any future dynamic roster lane. */ export declare function complianceCallDenial(denies: ReadonlySet<ComplianceCapability>, toolName: string): string | undefined;