@connexum/govern 0.0.0-stage → 0.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,48 @@
1
- # Temporary Holding Version
1
+ # @connexum/govern
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ One entry for all three My-CC layers around any agent (end-state D1, task 655).
4
+
5
+ ```ts
6
+ import { govern, GovernBlocked, GovernPaused } from '@connexum/govern'
7
+ import { LocalGate } from '@connexum/typescript-sdk'
8
+
9
+ const agent = govern({
10
+ agentId, passportId, governanceServerUrl: 'https://api.my-cc.io', token, // the agent's own service token
11
+ localGate, // optional: enforcing mode decides locally
12
+ sources: [{ sourceId: 'orders-db', tools: ['orders.'] }],
13
+ verification: { engine, tenantId, consumer, options: { leakageDenylist } },
14
+ })
15
+
16
+ await agent.tool('orders.update', input, (i) => updateOrder(i), { writes: true })
17
+ const answer = agent.release(modelResponse) // secrets and PHI blocked (or redacted) before use
18
+ const result = await agent.verify(claims, { snapshot }) // grounded, contradicted or unsupported
19
+ ```
20
+
21
+ Every tool call goes readiness, then runtime, then the tool body:
22
+
23
+ - **Readiness**: the source the tool reads (by tool-name prefix) must give this agent's passport access, from the
24
+ organization's sealed scans on My-CC. `none` blocks; `read_only` blocks a writing tool; an unscanned source, or an
25
+ unreachable My-CC with no earlier answer, blocks. Only the source id and passport id are sent.
26
+ - **Runtime**: a `LocalGate` in enforcing mode decides locally (approval-required actions park until a person decides,
27
+ task 465); otherwise the governance server's check-action decides.
28
+ - A no throws `GovernBlocked { layer, tool, reason }` or `GovernPaused { parkId, approvalId }`; the body never runs.
29
+
30
+ `release()` applies the model response check (task 466): `'block'` by default when the local gate is enforcing.
31
+ `verify()` hands the claims to your `VerificationEngine` (`@connexum/verification`).
32
+
33
+ ## Stack adapters (one line per tool)
34
+
35
+ ```ts
36
+ import { governLangChainTool, governOpenAITool, governClaudeTool } from '@connexum/govern'
37
+
38
+ const tools = [governLangChainTool(agent, ordersRead)] // LangChain JS and LangGraph JS (ToolNode)
39
+ const cancel = governOpenAITool(agent, cancelOrder, { writes: true }) // OpenAI Agents SDK (JS)
40
+ const server = createSdkMcpServer({ name: 'orders', tools: [governClaudeTool(agent, ordersRead)] }) // Claude Agent SDK
41
+ ```
42
+
43
+ Each keeps the framework's own tool object (name, schema, class), so the framework accepts it unchanged; only the call
44
+ point goes through `agent.tool()`. A no throws `GovernBlocked` or `GovernPaused` from that call point.
45
+
46
+ Not yet: an n8n node, the Python twin (LangGraph, CrewAI, OpenAI Agents and Claude Agent SDK in Python), and the
47
+ six-stack conformance set. Design:
48
+ `docs/specs/2026-10-21-govern-655-design.md`.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Stack adapters (task 655 slice 2, end-state D1): one line puts an existing framework tool under govern(). Each wraps
3
+ * the framework's own tool object, keeping its name, schema and class, so the framework accepts it unchanged; only the
4
+ * call point goes through agent.tool() (readiness, then the runtime gate, then the body). Structural: this package does
5
+ * not depend on any framework.
6
+ *
7
+ * LangChain JS and LangGraph JS governLangChainTool(agent, tool) wraps invoke(input | ToolCall, config)
8
+ * OpenAI Agents SDK (JS) governOpenAITool(agent, tool) wraps invoke(runContext, inputJson, details)
9
+ * Claude Agent SDK (TS) governClaudeTool(agent, tool) wraps handler(args, extra)
10
+ *
11
+ * A no throws GovernBlocked or GovernPaused from the call point; frameworks surface it as the tool's error.
12
+ */
13
+ import type { Governed } from './index.js';
14
+ export interface AdapterOptions {
15
+ /** Whether the tool writes (readiness blocks a writing tool on a read-only source). Default: false. */
16
+ writes?: boolean;
17
+ /** The current run id, if the framework has one (kept on a park so a release can resume it). */
18
+ runId?: () => string | undefined;
19
+ }
20
+ /** LangChain JS / LangGraph JS tool (StructuredTool, DynamicStructuredTool, tool()). */
21
+ export declare function governLangChainTool<T extends {
22
+ name: string;
23
+ invoke: (input: any, config?: any) => Promise<any>;
24
+ }>(agent: Governed, tool: T, opts?: AdapterOptions): T;
25
+ /** OpenAI Agents SDK (JS) function tool, from tool({ name, parameters, execute }). */
26
+ export declare function governOpenAITool<T extends {
27
+ name: string;
28
+ invoke: (runContext: any, input: string, details?: any) => Promise<any>;
29
+ }>(agent: Governed, tool: T, opts?: AdapterOptions): T;
30
+ /** Claude Agent SDK (TS) tool, from tool(name, description, inputSchema, handler); pass the result to createSdkMcpServer. */
31
+ export declare function governClaudeTool<T extends {
32
+ name: string;
33
+ handler: (args: any, extra: any) => Promise<any>;
34
+ }>(agent: Governed, tool: T, opts?: AdapterOptions): T;
35
+ //# sourceMappingURL=adapters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,uGAAuG;IACvG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gGAAgG;IAChG,KAAK,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAClC;AAaD,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAE,cAAmB,GAAG,CAAC,CAS1K;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAE,cAAmB,GAAG,CAAC,CAQ5L;AAED,6HAA6H;AAC7H,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAE,cAAmB,GAAG,CAAC,CAOrK"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.governLangChainTool = governLangChainTool;
4
+ exports.governOpenAITool = governOpenAITool;
5
+ exports.governClaudeTool = governClaudeTool;
6
+ const callOpts = (o) => {
7
+ const runId = o.runId?.();
8
+ return { ...(o.writes ? { writes: true } : {}), ...(runId ? { runId } : {}) };
9
+ };
10
+ function withCall(target, key, replacement) {
11
+ return new Proxy(target, {
12
+ get(t, p, r) { return p === key ? replacement : Reflect.get(t, p, r); },
13
+ });
14
+ }
15
+ /** LangChain JS / LangGraph JS tool (StructuredTool, DynamicStructuredTool, tool()). */
16
+ function governLangChainTool(agent, tool, opts = {}) {
17
+ const original = tool.invoke.bind(tool);
18
+ const invoke = async (input, config) => {
19
+ // LangGraph's ToolNode passes a ToolCall { name, args, id, type: 'tool_call' }; a direct call passes the args.
20
+ const args = input && typeof input === 'object' && input.type === 'tool_call' && input.args && typeof input.args === 'object' ? input.args : input;
21
+ const govInput = args && typeof args === 'object' ? args : { input: args };
22
+ return agent.tool(tool.name, govInput, () => original(input, config), callOpts(opts));
23
+ };
24
+ return withCall(tool, 'invoke', invoke);
25
+ }
26
+ /** OpenAI Agents SDK (JS) function tool, from tool({ name, parameters, execute }). */
27
+ function governOpenAITool(agent, tool, opts = {}) {
28
+ const original = tool.invoke.bind(tool);
29
+ const invoke = async (runContext, input, details) => {
30
+ let govInput;
31
+ try {
32
+ const parsed = JSON.parse(input);
33
+ govInput = parsed && typeof parsed === 'object' ? parsed : { input: parsed };
34
+ }
35
+ catch {
36
+ govInput = { input };
37
+ }
38
+ return agent.tool(tool.name, govInput, () => original(runContext, input, details), callOpts(opts));
39
+ };
40
+ return withCall(tool, 'invoke', invoke);
41
+ }
42
+ /** Claude Agent SDK (TS) tool, from tool(name, description, inputSchema, handler); pass the result to createSdkMcpServer. */
43
+ function governClaudeTool(agent, tool, opts = {}) {
44
+ const original = tool.handler;
45
+ const handler = async (args, extra) => {
46
+ const govInput = args && typeof args === 'object' ? args : { input: args };
47
+ return agent.tool(tool.name, govInput, () => original(args, extra), callOpts(opts));
48
+ };
49
+ return { ...tool, handler };
50
+ }
51
+ //# sourceMappingURL=adapters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":";;AAiCA,kDASC;AAGD,4CAQC;AAGD,4CAOC;AA1CD,MAAM,QAAQ,GAAG,CAAC,CAAiB,EAAE,EAAE;IACrC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;IAC1B,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAChF,CAAC,CAAC;AAEF,SAAS,QAAQ,CAAmB,MAAS,EAAE,GAAW,EAAE,WAAoB;IAC9E,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE;QACvB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAA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**
2
+ * @connexum/govern (task 655, end-state D1): one entry that puts any agent under all three My-CC layers.
3
+ *
4
+ * readiness before a tool reads a source: the source's access for this agent's passport (the organization's scans on
5
+ * My-CC); none blocks, read_only blocks a writing tool, an unscanned or unknown source blocks.
6
+ * runtime during: the customer's LocalGate in enforcing mode decides locally (park, release, fail closed);
7
+ * otherwise the governance server's check-action decides (advisory).
8
+ * correctness after: the agent's claims are checked by the consumer's VerificationEngine against a source snapshot.
9
+ *
10
+ * A layer that says no throws GovernBlocked (or GovernPaused); nothing runs after a no. Design:
11
+ * docs/specs/2026-10-21-govern-655-design.md.
12
+ */
13
+ import { type ResponseCheckMode } from '@connexum/typescript-sdk';
14
+ export type GovernLayer = 'readiness' | 'runtime' | 'response';
15
+ export declare class GovernBlocked extends Error {
16
+ readonly layer: GovernLayer;
17
+ readonly tool: string;
18
+ readonly reason: string;
19
+ constructor(layer: GovernLayer, tool: string, reason: string);
20
+ }
21
+ export declare class GovernPaused extends Error {
22
+ readonly tool: string;
23
+ readonly reason: string;
24
+ readonly parkId?: string | undefined;
25
+ readonly approvalId?: string | undefined;
26
+ constructor(tool: string, reason: string, parkId?: string | undefined, approvalId?: string | undefined);
27
+ }
28
+ /** The LocalGate surface govern uses (LocalGate in @connexum/typescript-sdk 0.1.0-beta.5 or later). */
29
+ export interface GovernLocalGate {
30
+ effective(): {
31
+ mode: 'advisory' | 'enforcing';
32
+ };
33
+ decide(action: {
34
+ toolName: string;
35
+ input?: Record<string, unknown>;
36
+ runId?: string;
37
+ }): {
38
+ decision: 'ALLOW' | 'DENY' | 'QUEUE' | 'PAUSE';
39
+ reason: string;
40
+ detail: string;
41
+ parkId?: string;
42
+ approvalId?: string;
43
+ };
44
+ }
45
+ /** The VerificationEngine surface govern uses (@connexum/verification). */
46
+ export interface GovernVerifier {
47
+ verify(req: {
48
+ tenantId: string;
49
+ consumer: unknown;
50
+ claims: unknown[];
51
+ snapshot?: unknown;
52
+ source?: unknown;
53
+ options?: Record<string, unknown>;
54
+ }): Promise<unknown>;
55
+ }
56
+ export interface GovernSource {
57
+ sourceId: string;
58
+ /** Tool name prefixes that read this source (e.g. 'orders.'). */
59
+ tools: string[];
60
+ }
61
+ export interface GovernOptions {
62
+ agentId: string;
63
+ agentName?: string;
64
+ /** The agent's passport id: readiness scans name the passports a source is exposed to. */
65
+ passportId: string;
66
+ governanceServerUrl: string;
67
+ /** The agent's own service token (or an operator token of its organization). */
68
+ token: string;
69
+ localGate?: GovernLocalGate;
70
+ sources?: GovernSource[];
71
+ /** options: engine options sent on every verify (for example the tenant's leakageDenylist of client names). */
72
+ verification?: {
73
+ engine: GovernVerifier;
74
+ tenantId: string;
75
+ consumer: unknown;
76
+ options?: Record<string, unknown>;
77
+ };
78
+ /** Model response check (466). Default: 'block' when the local gate is in enforcing mode, otherwise 'off'. */
79
+ responseCheck?: ResponseCheckMode;
80
+ /** How long a readiness answer is reused. Default 60 s. */
81
+ accessTtlMs?: number;
82
+ /** Server check-action behaviour when the server is unreachable (advisory runtime path). Default 'fail-closed'. */
83
+ onServerUnreachable?: 'fail-open' | 'fail-closed';
84
+ timeoutMs?: number;
85
+ fetch?: typeof fetch;
86
+ now?: () => number;
87
+ }
88
+ export interface GovernBlockRecord {
89
+ at: string;
90
+ layer: GovernLayer;
91
+ tool: string;
92
+ reason: string;
93
+ }
94
+ export interface Governed {
95
+ /** Readiness, then runtime, then the tool body. Throws GovernBlocked or GovernPaused instead of calling it. */
96
+ tool<T>(name: string, input: Record<string, unknown>, fn: (input: Record<string, unknown>) => Promise<T> | T, opts?: {
97
+ writes?: boolean;
98
+ runId?: string;
99
+ }): Promise<T>;
100
+ /** Check a model response before it is used (466). Throws GovernBlocked in block mode; returns a redacted copy in redact mode. */
101
+ release<T>(response: T): T;
102
+ /** Correctness after: verify the agent's claims with the configured engine. */
103
+ verify(claims: unknown[], from: {
104
+ snapshot?: unknown;
105
+ source?: unknown;
106
+ options?: Record<string, unknown>;
107
+ }): Promise<unknown>;
108
+ /** Recent blocks, newest first (for the caller's own display). */
109
+ blocks(): GovernBlockRecord[];
110
+ }
111
+ export declare function govern(opts: GovernOptions): Governed;
112
+ export { governLangChainTool, governOpenAITool, governClaudeTool } from './adapters.js';
113
+ export type { AdapterOptions } from './adapters.js';
114
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAA4C,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE5G,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/D,qBAAa,aAAc,SAAQ,KAAK;IAC1B,QAAQ,CAAC,KAAK,EAAE,WAAW;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAlE,KAAK,EAAE,WAAW,EAAW,IAAI,EAAE,MAAM,EAAW,MAAM,EAAE,MAAM;CAIxF;AAED,qBAAa,YAAa,SAAQ,KAAK;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM;gBAA7F,IAAI,EAAE,MAAM,EAAW,MAAM,EAAE,MAAM,EAAW,MAAM,CAAC,EAAE,MAAM,YAAA,EAAW,UAAU,CAAC,EAAE,MAAM,YAAA;CAInH;AAED,uGAAuG;AACvG,MAAM,WAAW,eAAe;IAC9B,SAAS,IAAI;QAAE,IAAI,EAAE,UAAU,GAAG,WAAW,CAAA;KAAE,CAAC;IAChD,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,M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BAAgB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,QAAQ,CA0FpD;AAED,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACxF,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.governClaudeTool = exports.governOpenAITool = exports.governLangChainTool = exports.GovernPaused = exports.GovernBlocked = void 0;
4
+ exports.govern = govern;
5
+ /**
6
+ * @connexum/govern (task 655, end-state D1): one entry that puts any agent under all three My-CC layers.
7
+ *
8
+ * readiness before a tool reads a source: the source's access for this agent's passport (the organization's scans on
9
+ * My-CC); none blocks, read_only blocks a writing tool, an unscanned or unknown source blocks.
10
+ * runtime during: the customer's LocalGate in enforcing mode decides locally (park, release, fail closed);
11
+ * otherwise the governance server's check-action decides (advisory).
12
+ * correctness after: the agent's claims are checked by the consumer's VerificationEngine against a source snapshot.
13
+ *
14
+ * A layer that says no throws GovernBlocked (or GovernPaused); nothing runs after a no. Design:
15
+ * docs/specs/2026-10-21-govern-655-design.md.
16
+ */
17
+ const typescript_sdk_1 = require("@connexum/typescript-sdk");
18
+ class GovernBlocked extends Error {
19
+ layer;
20
+ tool;
21
+ reason;
22
+ constructor(layer, tool, reason) {
23
+ super(`[${layer}] ${tool}: ${reason}`);
24
+ this.layer = layer;
25
+ this.tool = tool;
26
+ this.reason = reason;
27
+ this.name = 'GovernBlocked';
28
+ }
29
+ }
30
+ exports.GovernBlocked = GovernBlocked;
31
+ class GovernPaused extends Error {
32
+ tool;
33
+ reason;
34
+ parkId;
35
+ approvalId;
36
+ constructor(tool, reason, parkId, approvalId) {
37
+ super(`[runtime] ${tool} paused: ${reason}`);
38
+ this.tool = tool;
39
+ this.reason = reason;
40
+ this.parkId = parkId;
41
+ this.approvalId = approvalId;
42
+ this.name = 'GovernPaused';
43
+ }
44
+ }
45
+ exports.GovernPaused = GovernPaused;
46
+ function govern(opts) {
47
+ const fetchFn = opts.fetch ?? fetch;
48
+ const now = opts.now ?? Date.now;
49
+ const ttl = opts.accessTtlMs ?? 60_000;
50
+ const base = opts.governanceServerUrl.replace(/\/$/, '');
51
+ const access = new Map();
52
+ const blocks = [];
53
+ const server = new typescript_sdk_1.GovernanceHttpClient({
54
+ governanceServerUrl: base, licenseKey: opts.token,
55
+ onServerUnreachable: opts.onServerUnreachable ?? 'fail-closed',
56
+ ...(opts.timeoutMs !== undefined ? { timeoutMs: opts.timeoutMs } : {}),
57
+ defaultAgent: { name: opts.agentName ?? opts.agentId, role: 'governed-agent' },
58
+ });
59
+ const block = (layer, tool, reason) => {
60
+ blocks.push({ at: new Date(now()).toISOString(), layer, tool, reason });
61
+ if (blocks.length > 500)
62
+ blocks.shift();
63
+ throw new GovernBlocked(layer, tool, reason);
64
+ };
65
+ async function accessFor(sourceId) {
66
+ const hit = access.get(sourceId);
67
+ if (hit && now() - hit.at < ttl)
68
+ return hit;
69
+ try {
70
+ const r = await fetchFn(`${base}/api/v1/readiness/access?sourceId=${encodeURIComponent(sourceId)}&passportId=${encodeURIComponent(opts.passportId)}`, {
71
+ headers: { authorization: `Bearer ${opts.token}` }, signal: AbortSignal.timeout(opts.timeoutMs ?? 5000),
72
+ });
73
+ const b = (await r.json().catch(() => ({})));
74
+ if (r.ok && (b.access === 'full' || b.access === 'read_only' || b.access === 'none')) {
75
+ const answer = { access: b.access, reason: b.reason ?? 'enforcement', at: now() };
76
+ access.set(sourceId, answer);
77
+ return answer;
78
+ }
79
+ return hit ?? { access: 'none', reason: `readiness answer unavailable (http ${r.status})` };
80
+ }
81
+ catch (e) {
82
+ // Fail closed: an unreachable My-CC with no earlier answer gives no access; an earlier answer is reused.
83
+ return hit ?? { access: 'none', reason: `readiness answer unavailable: ${e.message.slice(0, 80)}` };
84
+ }
85
+ }
86
+ const responseMode = () => {
87
+ if (opts.responseCheck)
88
+ return opts.responseCheck;
89
+ try {
90
+ return opts.localGate?.effective().mode === 'enforcing' ? 'block' : 'off';
91
+ }
92
+ catch {
93
+ return 'block';
94
+ }
95
+ };
96
+ return {
97
+ async tool(name, input, fn, o = {}) {
98
+ // 1. Readiness: the source this tool reads, if any.
99
+ const src = (opts.sources ?? []).find((s) => s.tools.some((p) => name.startsWith(p)));
100
+ if (src) {
101
+ const a = await accessFor(src.sourceId);
102
+ if (a.access === 'none')
103
+ block('readiness', name, `source ${src.sourceId} gives this agent no access (${a.reason})`);
104
+ if (a.access === 'read_only' && o.writes)
105
+ block('readiness', name, `source ${src.sourceId} is read-only for this agent (${a.reason}); ${name} writes`);
106
+ }
107
+ // 2. Runtime: the local gate in enforcing mode, otherwise the governance server.
108
+ const local = opts.localGate;
109
+ if (local && local.effective().mode === 'enforcing') {
110
+ const d = local.decide({ toolName: name, input, ...(o.runId ? { runId: o.runId } : {}) });
111
+ if (d.decision === 'PAUSE' || d.decision === 'QUEUE') {
112
+ blocks.push({ at: new Date(now()).toISOString(), layer: 'runtime', tool: name, reason: `${d.reason}: ${d.detail}` });
113
+ throw new GovernPaused(name, `${d.reason}: ${d.detail}`, d.parkId, d.approvalId);
114
+ }
115
+ if (d.decision === 'DENY')
116
+ block('runtime', name, `${d.reason}: ${d.detail}`);
117
+ }
118
+ else {
119
+ const r = await server.check({ toolName: name, input, metadata: { agentId: opts.agentId, passportId: opts.passportId, source: '@connexum/govern', ...(o.runId ? { runId: o.runId } : {}) } });
120
+ if (r.decision === 'REQUIRE_APPROVAL') {
121
+ blocks.push({ at: new Date(now()).toISOString(), layer: 'runtime', tool: name, reason: r.reason ?? 'approval required' });
122
+ throw new GovernPaused(name, r.reason ?? 'approval required', undefined, r.approvalId);
123
+ }
124
+ if (r.decision !== 'ALLOW')
125
+ block('runtime', name, r.reason ?? 'denied by governance');
126
+ }
127
+ // 3. The tool body.
128
+ return fn(input);
129
+ },
130
+ release(response) {
131
+ const r = (0, typescript_sdk_1.checkModelResponse)(response, responseMode());
132
+ if (r.decision === 'BLOCK')
133
+ block('response', 'model', `local output guards matched ${r.guards.join(', ')}`);
134
+ return r.response;
135
+ },
136
+ async verify(claims, from) {
137
+ if (!opts.verification)
138
+ throw new Error('govern: no verification engine configured');
139
+ const { engine, tenantId, consumer } = opts.verification;
140
+ const options = { ...(opts.verification.options ?? {}), ...(from.options ?? {}) };
141
+ return engine.verify({ tenantId, consumer, claims, options, ...(from.snapshot !== undefined ? { snapshot: from.snapshot } : {}), ...(from.source !== undefined ? { source: from.source } : {}) });
142
+ },
143
+ blocks() { return blocks.slice().reverse(); },
144
+ };
145
+ }
146
+ var adapters_js_1 = require("./adapters.js");
147
+ Object.defineProperty(exports, "governLangChainTool", { enumerable: true, get: function () { return adapters_js_1.governLangChainTool; } });
148
+ Object.defineProperty(exports, "governOpenAITool", { enumerable: true, get: function () { return adapters_js_1.governOpenAITool; } });
149
+ Object.defineProperty(exports, "governClaudeTool", { enumerable: true, get: function () { return adapters_js_1.governClaudeTool; } });
150
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAqFA,wBA0FC;AA/KD;;;;;;;;;;;GAWG;AACH,6DAA4G;AAI5G,MAAa,aAAc,SAAQ,KAAK;IACjB;IAA6B;IAAuB;IAAzE,YAAqB,KAAkB,EAAW,IAAY,EAAW,MAAc;QACrF,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,MAAM,EAAE,CAAC,CAAC;QADpB,UAAK,GAAL,KAAK,CAAa;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAAW,WAAM,GAAN,MAAM,CAAQ;QAErF,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AALD,sCAKC;AAED,MAAa,YAAa,SAAQ,KAAK;IAChB;IAAuB;IAAyB;IAA0B;IAA/F,YAAqB,IAAY,EAAW,MAAc,EAAW,MAAe,EAAW,UAAm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+GAAA,gBAAgB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "@connexum/govern",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-beta.2",
4
+ "private": false,
5
+ "description": "One entry for all three My-CC layers around any agent: data readiness before a tool reads a source, the runtime gate during (the local enforcing gate or the governance server), and correctness after (verification of the agent's claims). Thin stack adapters wrap it; the agent's own code calls govern().tool(), .release() and .verify().",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "typecheck": "tsc --noEmit",
11
+ "test": "npx tsx --test --test-force-exit --test-timeout=120000 tests/*.test.mts"
12
+ },
13
+ "dependencies": {
14
+ "@connexum/typescript-sdk": "^0.1.0-beta.9"
15
+ },
16
+ "devDependencies": {
17
+ "@anthropic-ai/claude-agent-sdk": "^0.3.306",
18
+ "@connexum/verification": "0.1.0-beta.4",
19
+ "@langchain/core": "^1.2.20",
20
+ "@openai/agents": "^0.21.0",
21
+ "@types/node": "^20.0.0",
22
+ "tsx": "^4.19.0",
23
+ "typescript": "^5.4.0",
24
+ "zod": "^4.6.7"
25
+ },
26
+ "engines": {
27
+ "node": ">=20.0.0"
28
+ },
29
+ "license": "SEE LICENSE IN ../../LICENSE.md",
30
+ "files": [
31
+ "dist",
32
+ "README.md"
33
+ ],
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/Glasgowlad1/AI-Agents-GS.git",
40
+ "directory": "packages/govern"
41
+ }
42
+ }