@agentguard-run/spend 0.14.1 → 0.15.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 0.15.1
2
+
3
+ - Removed import-time `sdk_init` telemetry from package entry points. Telemetry remains opt-in and now fires lazily when `SpendGuard` is constructed.
4
+ - Added lazy-import regression tests so root SDK and Operating Pack imports make zero HTTP calls and open zero network sockets even when telemetry is enabled.
5
+
6
+ ## 0.15.0
7
+
8
+ - Added the Agent Operating Pack for law: bundled AGENTS.md guardrails, five local skills, source-of-truth layout, DIY checklist, and counsel-review-pending marker.
9
+ - Added TypeScript and Python Operating Pack envelopes with capability gates, per-workflow spend caps, Reviewer Cascade on the high-risk subset, and Ed25519 signed metadata-only DAG receipts.
10
+ - Added tests for static pack guardrails, dispatch and trust-account gating, Reviewer Cascade receipts, tamper detection, and zero-data-plane behavior.
11
+
1
12
  ## 0.14.0
2
13
 
3
14
  - Added Hermes Kanban adapters for TypeScript and Python with governed task envelopes, per-task spend caps, profile capability ceilings, reclaim receipts, and signed DAG receipt trees.
package/dist/index.d.ts CHANGED
@@ -33,7 +33,7 @@ export { withSpendGuardAnthropic, type AnthropicBindingOptions } from './binding
33
33
  export { withSpendGuardBedrock, type BedrockBindingOptions } from './bindings/bedrock';
34
34
  export { recommend, defaultKey, type ModelRouteRecommendation, type RecommendOptions } from './router';
35
35
  export { DEFAULT_LOCALE, SUPPORTED_LOCALES, TRANSLATIONS, type SupportedLocale, resolveLocale, t, formatBlockedTrace, type BlockedTraceArgs, } from './i18n';
36
- export declare const AGENTGUARD_SPEND_VERSION = "0.14.1";
36
+ export declare const AGENTGUARD_SPEND_VERSION = "0.15.1";
37
37
  export declare const agentguard: {
38
38
  workflow: typeof runWorkflow;
39
39
  };
@@ -44,4 +44,5 @@ export * from './verticals';
44
44
  export * from './governance';
45
45
  export * from './byo';
46
46
  export * from './frameworks';
47
+ export * from './operating-pack';
47
48
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG7D,YAAY,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,eAAe,EACf,cAAc,EACd,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,UAAU,EACV,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EACpB,eAAe,EACf,KAAK,SAAS,GACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAGvK,OAAO,EACL,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EACL,8BAA8B,EAC9B,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,cAAc,GACpB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ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UAAU,EAAE,KAAK,wBAAwB,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGvG,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,eAAe,EACpB,aAAa,EACb,CAAC,EACD,kBAAkB,EAClB,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAC;AAEhB,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAGjD,eAAO,MAAM,UAAU;;CAEtB,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,aAAa,QAG8B,CAAC;AACzD,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AAEtB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -24,7 +24,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.computeDagEntryHash = exports.compressReceiptDag = exports.receiptSchemaVersion = exports.isReceiptV3 = exports.assertReceiptV3 = exports.isOpenRouterHost = exports.clearManagedOpenRouterKeyCache = exports.fetchManagedOpenRouterKey = exports.modelCostFromOpenRouter = exports.persistOverrides = exports.syncPricingIntoCostTable = exports.getCachedCatalog = exports.fetchCatalog = exports.recordTelemetryEvent = exports.resetTelemetryInstallId = exports.disableTelemetry = exports.enableTelemetry = exports.telemetryStatus = exports.licenseKeyFingerprint = exports.clearConfiguredLicenseKey = exports.writeConfiguredLicenseKey = exports.readConfiguredLicenseKey = exports.validateAndRegisterLicense = exports.validateLicenseKey = exports.AgentGuardLicenseRequiredError = exports.InMemorySpendStore = exports.InMemoryDecisionLogStore = exports.GENESIS_PREVIOUS_HASH = exports.verifyChain = exports.verifyEntry = exports.signDecision = exports.computeSignerFingerprint = exports.computeEntryHash = exports.sha256Hex = exports.canonicalJson = exports.BUILT_IN_KEYWORD_WATCHLISTS = exports.findCustomKeywordWatchlists = exports.enforcePolicyLicenseGates = exports.adjustPolicyWindowSpend = exports.buildScopeKey = exports.evaluatePolicy = exports.knownModelCosts = exports.persistCostOverrides = exports.loadPersistedCostOverrides = exports.listCostOverrides = exports.inferProvider = exports.computeCallCents = exports.clearCostOverrides = exports.setCostOverride = exports.getModelCost = void 0;
25
25
  exports.formatBlockedTrace = exports.t = exports.resolveLocale = exports.TRANSLATIONS = exports.SUPPORTED_LOCALES = exports.DEFAULT_LOCALE = exports.defaultKey = exports.recommend = exports.withSpendGuardBedrock = exports.withSpendGuardAnthropic = exports.AgentGuardBlockedError = exports.withSpendGuard = exports.SpendGuard = exports.writeAdvisorOutputs = exports.createAdvisorSessionLogger = exports.resolveAdvisorApiKey = exports.createAdvisorClient = exports.projectedSavings = exports.buildPolicyFromProfile = exports.buildBusinessProfile = exports.AdvisorConversation = exports.AgentGuardWorkflowStateError = exports.AgentGuardDurationCapError = exports.AgentGuardChainCorruptError = exports.AgentGuardBudgetCapError = exports.validateReceiptChain = exports.computeChainHash = exports.WorkflowContext = exports.workflow = exports.verifyConsentReceipt = exports.enforceCompliance = exports.AgentGuardConsentRequiredError = exports.AgentGuardComplianceError = exports.isForeignOriginModel = exports.inferCompliance = exports.inferHosting = exports.inferModelIdentity = exports.inferProviderRoute = exports.PROVIDER_REGISTRY = exports.captureProvenance = exports.verifyReceiptDag = exports.verifyInclusion = exports.signDagNode = exports.msgHashForDecision = exports.merkleRoot = exports.merkleInclusionProof = exports.gateCapability = exports.deriveTrustScore = exports.deriveCapability = exports.dagEnvelopeFromEntries = void 0;
26
26
  exports.PATENT_NOTICE = exports.agentguard = exports.AGENTGUARD_SPEND_VERSION = void 0;
27
- const telemetry_1 = require("./telemetry");
28
27
  const context_1 = require("./workflow/context");
29
28
  // Cost table
30
29
  var cost_table_1 = require("./cost-table");
@@ -69,12 +68,12 @@ Object.defineProperty(exports, "writeConfiguredLicenseKey", { enumerable: true,
69
68
  Object.defineProperty(exports, "clearConfiguredLicenseKey", { enumerable: true, get: function () { return license_1.clearConfiguredLicenseKey; } });
70
69
  Object.defineProperty(exports, "licenseKeyFingerprint", { enumerable: true, get: function () { return license_1.licenseKeyFingerprint; } });
71
70
  // Telemetry controls
72
- var telemetry_2 = require("./telemetry");
73
- Object.defineProperty(exports, "telemetryStatus", { enumerable: true, get: function () { return telemetry_2.telemetryStatus; } });
74
- Object.defineProperty(exports, "enableTelemetry", { enumerable: true, get: function () { return telemetry_2.enableTelemetry; } });
75
- Object.defineProperty(exports, "disableTelemetry", { enumerable: true, get: function () { return telemetry_2.disableTelemetry; } });
76
- Object.defineProperty(exports, "resetTelemetryInstallId", { enumerable: true, get: function () { return telemetry_2.resetTelemetryInstallId; } });
77
- Object.defineProperty(exports, "recordTelemetryEvent", { enumerable: true, get: function () { return telemetry_2.recordTelemetryEvent; } });
71
+ var telemetry_1 = require("./telemetry");
72
+ Object.defineProperty(exports, "telemetryStatus", { enumerable: true, get: function () { return telemetry_1.telemetryStatus; } });
73
+ Object.defineProperty(exports, "enableTelemetry", { enumerable: true, get: function () { return telemetry_1.enableTelemetry; } });
74
+ Object.defineProperty(exports, "disableTelemetry", { enumerable: true, get: function () { return telemetry_1.disableTelemetry; } });
75
+ Object.defineProperty(exports, "resetTelemetryInstallId", { enumerable: true, get: function () { return telemetry_1.resetTelemetryInstallId; } });
76
+ Object.defineProperty(exports, "recordTelemetryEvent", { enumerable: true, get: function () { return telemetry_1.recordTelemetryEvent; } });
78
77
  // OpenRouter catalog
79
78
  var openrouter_catalog_1 = require("./openrouter-catalog");
80
79
  Object.defineProperty(exports, "fetchCatalog", { enumerable: true, get: function () { return openrouter_catalog_1.fetchCatalog; } });
@@ -161,7 +160,7 @@ Object.defineProperty(exports, "TRANSLATIONS", { enumerable: true, get: function
161
160
  Object.defineProperty(exports, "resolveLocale", { enumerable: true, get: function () { return i18n_1.resolveLocale; } });
162
161
  Object.defineProperty(exports, "t", { enumerable: true, get: function () { return i18n_1.t; } });
163
162
  Object.defineProperty(exports, "formatBlockedTrace", { enumerable: true, get: function () { return i18n_1.formatBlockedTrace; } });
164
- exports.AGENTGUARD_SPEND_VERSION = '0.14.1';
163
+ exports.AGENTGUARD_SPEND_VERSION = '0.15.1';
165
164
  exports.agentguard = {
166
165
  workflow: context_1.workflow,
167
166
  };
@@ -169,10 +168,10 @@ exports.agentguard = {
169
168
  exports.PATENT_NOTICE = 'Protected by U.S. patent-pending technology ' +
170
169
  '(App. Nos. 63/983,615; 63/983,621; 63/983,843; 63/984,626; ' +
171
170
  '64/071,781; 64/071,789). Additional patents pending.';
172
- (0, telemetry_1.recordTelemetryEvent)('sdk_init');
173
171
  __exportStar(require("./outcomes"), exports);
174
172
  __exportStar(require("./verticals"), exports);
175
173
  __exportStar(require("./governance"), exports);
176
174
  __exportStar(require("./byo"), exports);
177
175
  __exportStar(require("./frameworks"), exports);
176
+ __exportStar(require("./operating-pack"), exports);
178
177
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;AAEH,2CAA8E;AAC9E,gDAA6D;AAmB7D,aAAa;AACb,2CAWsB;AAVpB,0GAAA,YAAY,OAAA;AACZ,6GAAA,eAAe,OAAA;AACf,gHAAA,kBAAkB,OAAA;AAClB,8GAAA,gBAAgB,OAAA;AAChB,2GAAA,aAAa,OAAA;AACb,+GAAA,iBAAiB,OAAA;AACjB,wHAAA,0BAA0B,OAAA;AAC1B,kHAAA,oBAAoB,OAAA;AACpB,6GAAA,eAAe,OAAA;AAIjB,gBAAgB;AAChB,mCAAuK;AAA9J,wGAAA,cAAc,OAAA;AAAE,uGAAA,aAAa,OAAA;AAAE,iHAAA,uBAAuB,OAAA;AAAE,mHAAA,yBAAyB,OAAA;AAAE,qHAAA,2BAA2B,OAAA;AAAE,qHAAA,2BAA2B,OAAA;AAEpJ,eAAe;AACf,+CAUwB;AATtB,6GAAA,aAAa,OAAA;AACb,yGA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GAAA,UAAU,OAAA;AAE9B,sCAAsC;AACtC,+BASgB;AARd,sGAAA,cAAc,OAAA;AACd,yGAAA,iBAAiB,OAAA;AACjB,oGAAA,YAAY,OAAA;AAEZ,qGAAA,aAAa,OAAA;AACb,yFAAA,CAAC,OAAA;AACD,0GAAA,kBAAkB,OAAA;AAIP,QAAA,wBAAwB,GAAG,QAAQ,CAAC;AAGpC,QAAA,UAAU,GAAG;IACxB,QAAQ,EAAE,kBAAW;CACtB,CAAC;AAEF,2DAA2D;AAC9C,QAAA,aAAa,GACxB,8CAA8C;IAC9C,6DAA6D;IAC7D,sDAAsD,CAAC;AACzD,6CAA2B;AAC3B,8CAA4B;AAC5B,+CAA6B;AAC7B,wCAAsB;AAEtB,+CAA6B;AAC7B,mDAAiC"}
@@ -0,0 +1,88 @@
1
+ import { verifyReceiptDag, type ReceiptCapabilityLevel, type ReceiptDagEnvelope, type ReceiptDagNode } from './receipts/dag';
2
+ export type OperatingPackVertical = 'law';
3
+ export type OperatingPackActionKind = 'intake' | 'conflict_check' | 'document_summary' | 'billing_reconciliation' | 'client_update_draft' | 'send_client_email' | 'trust_account_action';
4
+ export interface OperatingPackSigningKeys {
5
+ privateKey: Uint8Array;
6
+ publicKey: Uint8Array;
7
+ }
8
+ export interface OperatingPackReviewerCascadeOptions {
9
+ enabled?: boolean;
10
+ drafterModel?: string;
11
+ reviewerModel?: string;
12
+ triggerThreshold?: number;
13
+ drafterMaxCostCents?: number;
14
+ reviewerMaxCostCents?: number;
15
+ }
16
+ export interface OperatingPackOptions {
17
+ vertical: OperatingPackVertical;
18
+ workflowId: string;
19
+ signingKeys: OperatingPackSigningKeys;
20
+ approvedCapabilities?: ReceiptCapabilityLevel[];
21
+ reviewerCascade?: OperatingPackReviewerCascadeOptions;
22
+ maxWorkflowCostCents?: number;
23
+ }
24
+ export interface OperatingPackAction {
25
+ actionId: string;
26
+ kind: OperatingPackActionKind;
27
+ capability?: ReceiptCapabilityLevel;
28
+ highRisk?: boolean;
29
+ highRiskClassifierScore?: number;
30
+ keywordRisk?: boolean;
31
+ modelIds?: string[];
32
+ tokenCounts?: {
33
+ inputTokens?: number;
34
+ outputTokens?: number;
35
+ };
36
+ totalCostCents?: number;
37
+ metadata?: Record<string, unknown>;
38
+ reviewerVerdict?: 'drafter_only' | 'review_required' | 'approved' | 'rejected';
39
+ }
40
+ export interface OperatingPackGuardResult {
41
+ allowed: boolean;
42
+ reason: string;
43
+ node: ReceiptDagNode;
44
+ dag: ReceiptDagEnvelope;
45
+ reviewerCascadeTriggered: boolean;
46
+ spentCents: number;
47
+ }
48
+ export interface OperatingPackSkillTemplate {
49
+ slug: string;
50
+ title: string;
51
+ capability: ReceiptCapabilityLevel;
52
+ reviewerCascade: boolean;
53
+ markdown: string;
54
+ }
55
+ export interface OperatingPackDefinition {
56
+ vertical: OperatingPackVertical;
57
+ title: string;
58
+ counselReviewPending: boolean;
59
+ agentsMd: string;
60
+ skills: Record<string, OperatingPackSkillTemplate>;
61
+ sourceOfTruth: string;
62
+ checklist: string[];
63
+ capabilityTable: Array<{
64
+ capability: ReceiptCapabilityLevel;
65
+ use: string;
66
+ blockedExamples: string[];
67
+ }>;
68
+ }
69
+ export declare const LAW_OPERATING_PACK: OperatingPackDefinition;
70
+ export declare function createOperatingPackEnvelope(opts: OperatingPackOptions): OperatingPackEnvelope;
71
+ export declare class OperatingPackEnvelope {
72
+ private readonly opts;
73
+ private readonly nodes;
74
+ private readonly approvedCapabilities;
75
+ private spentCents;
76
+ constructor(opts: OperatingPackOptions);
77
+ getPack(): OperatingPackDefinition;
78
+ guardAction(input: OperatingPackAction): Promise<OperatingPackGuardResult>;
79
+ getReceiptDag(): ReceiptDagEnvelope;
80
+ verifyDag(publicKeyHex?: string): Promise<Awaited<ReturnType<typeof verifyReceiptDag>>>;
81
+ outboundPayloads(): Record<string, unknown>[];
82
+ signerFingerprint(): string;
83
+ private hasCapability;
84
+ private signActionNode;
85
+ }
86
+ export declare function assertOperatingPackMetadataOnly(value: unknown, path?: string): void;
87
+ export declare function operatingPackSignerFingerprint(opts: OperatingPackOptions): string | null;
88
+ //# sourceMappingURL=operating-pack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operating-pack.d.ts","sourceRoot":"","sources":["../src/operating-pack.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG1I,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAC1C,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,gBAAgB,GAChB,kBAAkB,GAClB,wBAAwB,GACxB,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mCAAmC;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,qBAAqB,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,wBAAwB,CAAC;IACtC,oBAAoB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAChD,eAAe,CAAC,EAAE,mCAAmC,CAAC;IACtD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,QAAQ,CAAC,EA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AA;KAAE,CAAC,CAAC;CACxG;AA8BD,eAAO,MAAM,kBAAkB,EAAE,uBA0DhC,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,oBAAoB,GAAG,qBAAqB,CAE7F;AAED,qBAAa,qBAAqB;IAKpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwB;IAC9C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA8B;IACnE,OAAO,CAAC,UAAU,CAAK;gBAEM,IAAI,EAAE,oBAAoB;IAMvD,OAAO,IAAI,uBAAuB;IAI5B,WAAW,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAuBhF,aAAa,IAAI,kBAAkB;IAK7B,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC;IAI7F,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAI7C,iBAAiB,IAAI,MAAM;IAI3B,OAAO,CAAC,aAAa;YAOP,cAAc;CAc7B;AAuFD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,SAAa,GAAG,IAAI,CAEvF;AAyDD,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,GAAG,IAAI,CAExF"}
@@ -0,0 +1,329 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperatingPackEnvelope = exports.LAW_OPERATING_PACK = void 0;
4
+ exports.createOperatingPackEnvelope = createOperatingPackEnvelope;
5
+ exports.assertOperatingPackMetadataOnly = assertOperatingPackMetadataOnly;
6
+ exports.operatingPackSignerFingerprint = operatingPackSignerFingerprint;
7
+ const crypto_1 = require("crypto");
8
+ const decision_log_1 = require("./decision-log");
9
+ const dag_1 = require("./receipts/dag");
10
+ const CAPABILITY_RANK = {
11
+ READ_ONLY: 0,
12
+ TRANSACT: 1,
13
+ ADMIN: 2,
14
+ ORCHESTRATE: 3,
15
+ };
16
+ const DATA_PLANE_KEYS = /^(title|summary|prompt|completion|content|messages|input|output|text|raw|source|notes|draft|body|transcript|document|client_content|clientContent|matter_description|email_body|file_text)$/i;
17
+ const SAFE_METADATA_KEYS = new Set([
18
+ 'action_id',
19
+ 'action_kind',
20
+ 'billing_code',
21
+ 'capability',
22
+ 'cost_cents',
23
+ 'duration_ms',
24
+ 'event',
25
+ 'jurisdiction',
26
+ 'matter_hash',
27
+ 'model',
28
+ 'model_id',
29
+ 'outcome',
30
+ 'practice_area',
31
+ 'review_status',
32
+ 'risk_score',
33
+ 'token_count',
34
+ 'workflow_id',
35
+ ]);
36
+ exports.LAW_OPERATING_PACK = {
37
+ vertical: 'law',
38
+ title: 'AgentGuard Law Operating Pack',
39
+ counselReviewPending: true,
40
+ agentsMd: `# AgentGuard Law Operating Pack\n\nCounsel review pending: this file is operating scaffolding for legal workflows and should be reviewed by your counsel before production use.\n\n## Guardrails\n\n- ABA Model Rule 1.6: protect client information. Do not paste client content into tools that are not approved for the matter.\n- Conflicts: run conflict checks before intake work advances to drafting or client communication.\n- No unauthorized practice of law: agents prepare drafts and metadata. A licensed attorney reviews legal judgment.\n- Draft before send: client-facing emails and filings are drafts until a human approves dispatch.\n- Retention: keep signed AgentGuard receipts and matter metadata according to firm policy. Do not store prompt or completion content in receipts.\n- Trust account actions: trust transfers, disbursement instructions, and ledger changes require ADMIN capability.\n\n## Capability Map\n\n- READ_ONLY: intake classification, conflict pre-checks, document summaries, billing reconciliation previews.\n- TRANSACT: create a client-update draft or prepare a dispatch packet.\n- ADMIN: trust-account actions, retention policy changes, capability changes.\n- ORCHESTRATE: assign or revoke agent work across matters.\n`,
41
+ skills: {
42
+ intake: {
43
+ slug: 'intake',
44
+ title: 'Intake Skill',
45
+ capability: 'READ_ONLY',
46
+ reviewerCascade: false,
47
+ markdown: `# Intake Skill\n\nPurpose: classify a new inquiry using matter metadata only.\n\nInputs: jurisdiction, practice area, referral source, matter hash, urgency flag.\n\nRules:\n- Do not ask the model to decide representation.\n- Do not place client narrative text in AgentGuard receipts.\n- Output a routing label, missing-information checklist, and conflict-check reminder.\n`,
48
+ },
49
+ 'conflict-check': {
50
+ slug: 'conflict-check',
51
+ title: 'Conflict Check Skill',
52
+ capability: 'READ_ONLY',
53
+ reviewerCascade: true,
54
+ markdown: `# Conflict Check Skill\n\nPurpose: prepare a conflict pre-check packet from firm metadata.\n\nInputs: matter hash, party hashes, jurisdiction, practice area, intake source.\n\nRules:\n- Match on firm-approved metadata systems only.\n- Refuse if party identity data is incomplete.\n- Reviewer Cascade triggers when a possible match, former-client marker, adverse-party marker, or trust-account marker appears.\n`,
55
+ },
56
+ 'document-summary': {
57
+ slug: 'document-summary',
58
+ title: 'Document Summary Skill',
59
+ capability: 'READ_ONLY',
60
+ reviewerCascade: true,
61
+ markdown: `# Document Summary Skill\n\nPurpose: produce a working summary for attorney review.\n\nInputs: document hash, document type, jurisdiction, matter hash, token counts.\n\nRules:\n- Cite document sections or refuse when citations are unavailable.\n- Mark all output as draft work product for attorney review.\n- Reviewer Cascade triggers for settlement, privilege, indemnity, non-compete, waiver, trust, sanctions, or deadline markers.\n`,
62
+ },
63
+ 'billing-reconciliation': {
64
+ slug: 'billing-reconciliation',
65
+ title: 'Billing Reconciliation Skill',
66
+ capability: 'READ_ONLY',
67
+ reviewerCascade: false,
68
+ markdown: `# Billing Reconciliation Skill\n\nPurpose: compare time-entry metadata against matter budgets and billing codes.\n\nInputs: billing code, matter hash, time-entry hashes, amount cents, policy cap.\n\nRules:\n- Do not move money.\n- Do not alter trust ledgers.\n- Escalate to ADMIN before any trust-account action.\n`,
69
+ },
70
+ 'client-update-draft': {
71
+ slug: 'client-update-draft',
72
+ title: 'Client Update Draft Skill',
73
+ capability: 'TRANSACT',
74
+ reviewerCascade: true,
75
+ markdown: `# Client Update Draft Skill\n\nPurpose: draft a client update for attorney review.\n\nInputs: matter hash, milestone label, jurisdiction, practice area, cited record hashes.\n\nRules:\n- Draft before send. Never dispatch directly.\n- Include a review status field before any client-facing use.\n- Reviewer Cascade triggers for deadline, settlement, privilege, fee, trust, or adverse-party markers.\n`,
76
+ },
77
+ },
78
+ sourceOfTruth: `# Source Of Truth Layout\n\nUse this local layout inside the firm environment.\n\n- matters/<matter-hash>/metadata.json\n- matters/<matter-hash>/parties.json\n- matters/<matter-hash>/documents/<document-hash>.json\n- matters/<matter-hash>/receipts/*.json\n- policies/agentguard-policy.yaml\n- logs/agentguard-decisions.ndjson\n\nAgentGuard receipts store metadata, hashes, costs, model identifiers, capability decisions, and signatures. They do not store prompt or completion content.\n`,
79
+ checklist: [
80
+ 'Review AGENTS.md with firm counsel before production use.',
81
+ 'Define matter hash and party hash conventions.',
82
+ 'Map each skill to a capability tier.',
83
+ 'Enable Reviewer Cascade for client updates, conflicts, and document summaries.',
84
+ 'Set a per-matter and per-day spend cap.',
85
+ 'Store signed receipts with matter metadata only.',
86
+ 'Test trust-account actions with ADMIN capability denied by default.',
87
+ ],
88
+ capabilityTable: [
89
+ { capability: 'READ_ONLY', use: 'Classify, summarize, reconcile, and prepare metadata-only packets.', blockedExamples: ['Sending client email', 'Trust ledger update'] },
90
+ { capability: 'TRANSACT', use: 'Create dispatch-ready drafts that still require human approval.', blockedExamples: ['Trust transfer', 'Policy change'] },
91
+ { capability: 'ADMIN', use: 'Trust-account actions, retention changes, and capability grants.', blockedExamples: ['Unreviewed client dispatch'] },
92
+ { capability: 'ORCHESTRATE', use: 'Assign, revoke, or coordinate multiple matter agents.', blockedExamples: ['Bypassing capability review'] },
93
+ ],
94
+ };
95
+ function createOperatingPackEnvelope(opts) {
96
+ return new OperatingPackEnvelope(opts);
97
+ }
98
+ class OperatingPackEnvelope {
99
+ opts;
100
+ nodes = [];
101
+ approvedCapabilities;
102
+ spentCents = 0;
103
+ constructor(opts) {
104
+ this.opts = opts;
105
+ if (opts.vertical !== 'law')
106
+ throw new Error('Only the law operating pack is bundled in this release');
107
+ if (!safeLabel(opts.workflowId))
108
+ throw new Error('Operating Pack workflowId is required');
109
+ this.approvedCapabilities = new Set(opts.approvedCapabilities ?? ['READ_ONLY']);
110
+ }
111
+ getPack() {
112
+ return exports.LAW_OPERATING_PACK;
113
+ }
114
+ async guardAction(input) {
115
+ assertAction(input);
116
+ assertMetadataOnly(input.metadata ?? {});
117
+ const capability = input.capability ?? capabilityForAction(input.kind);
118
+ const cost = safeNonNegativeInteger(input.totalCostCents);
119
+ const spendExceeded = Number.isSafeInteger(this.opts.maxWorkflowCostCents) && this.opts.maxWorkflowCostCents >= 0 && this.spentCents + cost > this.opts.maxWorkflowCostCents;
120
+ const capabilityAllowed = this.hasCapability(capability);
121
+ const allowed = capabilityAllowed && !spendExceeded;
122
+ const reason = !capabilityAllowed ? `Capability ${capability} is required for ${input.kind}` : spendExceeded ? 'Operating Pack workflow spend cap reached' : 'Operating Pack action allowed';
123
+ if (allowed)
124
+ this.spentCents += cost;
125
+ const triggers = allowed ? reviewerCascadeTriggers(input, this.opts) : [];
126
+ const node = await this.signActionNode(input, capability, allowed, reason, triggers);
127
+ this.nodes.push(node);
128
+ return {
129
+ allowed,
130
+ reason,
131
+ node,
132
+ dag: this.getReceiptDag(),
133
+ reviewerCascadeTriggered: triggers.length > 0,
134
+ spentCents: this.spentCents,
135
+ };
136
+ }
137
+ getReceiptDag() {
138
+ const root = this.nodes[this.nodes.length - 1];
139
+ return { nodes: [...this.nodes], rootId: root?.entryHash ?? '0'.repeat(64), workflowId: workflowHash(this.opts.workflowId) };
140
+ }
141
+ async verifyDag(publicKeyHex) {
142
+ return (0, dag_1.verifyReceiptDag)(this.getReceiptDag(), publicKeyHex ?? Buffer.from(this.opts.signingKeys.publicKey).toString('hex'));
143
+ }
144
+ outboundPayloads() {
145
+ return [];
146
+ }
147
+ signerFingerprint() {
148
+ return (0, decision_log_1.computeSignerFingerprint)(this.opts.signingKeys.publicKey);
149
+ }
150
+ hasCapability(capability) {
151
+ for (const granted of this.approvedCapabilities) {
152
+ if (CAPABILITY_RANK[granted] >= CAPABILITY_RANK[capability])
153
+ return true;
154
+ }
155
+ return false;
156
+ }
157
+ async signActionNode(input, capability, allowed, reason, triggers) {
158
+ const decision = operatingPackDecision(input, this.opts, capability, allowed, reason, triggers, this.spentCents);
159
+ return (0, dag_1.signDagNode)({
160
+ sequence: this.nodes.length,
161
+ decision,
162
+ privateKey: this.opts.signingKeys.privateKey,
163
+ publicKey: this.opts.signingKeys.publicKey,
164
+ parents: this.nodes.length ? [this.nodes[this.nodes.length - 1]] : [],
165
+ workflowId: workflowHash(this.opts.workflowId),
166
+ trustScore: allowed ? (triggers.length ? 0.9 : 0.94) : 0.2,
167
+ blocked: !allowed,
168
+ capability,
169
+ });
170
+ }
171
+ }
172
+ exports.OperatingPackEnvelope = OperatingPackEnvelope;
173
+ function operatingPackDecision(input, opts, capability, allowed, reason, triggers, spentCents) {
174
+ const cost = safeNonNegativeInteger(input.totalCostCents);
175
+ const inputTokens = safeNonNegativeInteger(input.tokenCounts?.inputTokens);
176
+ const outputTokens = safeNonNegativeInteger(input.tokenCounts?.outputTokens);
177
+ const receipt = {
178
+ type: 'agent_operating_pack_action',
179
+ vertical: opts.vertical,
180
+ counselReviewPending: exports.LAW_OPERATING_PACK.counselReviewPending,
181
+ workflowHash: workflowHash(opts.workflowId),
182
+ actionId: safeLabel(input.actionId) ?? hashValue(input.actionId).slice(0, 16),
183
+ actionKind: input.kind,
184
+ capability,
185
+ blocked: !allowed,
186
+ modelIds: safeModelIds(input.modelIds ?? []),
187
+ inputTokens,
188
+ outputTokens,
189
+ totalCostCents: cost,
190
+ metadata: filterReceiptMetadata({ ...(input.metadata ?? {}), action_kind: input.kind, capability }),
191
+ };
192
+ if (triggers.length > 0)
193
+ receipt.reviewerCascade = buildReviewerCascadeReceipt(input, opts, triggers);
194
+ return {
195
+ decisionId: (0, crypto_1.randomUUID)(),
196
+ timestamp: new Date().toISOString(),
197
+ action: allowed ? 'allow' : 'block',
198
+ triggeredCap: allowed ? null : { window: 'per_call', amountCents: cost, action: 'block', reason },
199
+ triggeredScopeKey: null,
200
+ projectedCents: cost,
201
+ windowSpendBefore: Math.max(0, spentCents - (allowed ? cost : 0)),
202
+ windowSpendAfter: spentCents,
203
+ provider: 'unknown',
204
+ modelRequested: 'operating-pack',
205
+ modelResolved: 'operating-pack',
206
+ policyId: 'agentguard-operating-pack-law',
207
+ policyVersion: 1,
208
+ enforcementMode: 'enforce',
209
+ reasons: [reason],
210
+ entryType: 'outcome',
211
+ outcomeReceipt: receipt,
212
+ };
213
+ }
214
+ function buildReviewerCascadeReceipt(input, opts, triggers) {
215
+ const cascade = opts.reviewerCascade ?? {};
216
+ return {
217
+ outcome: input.kind,
218
+ drafter: {
219
+ model: safeLabel(cascade.drafterModel) ?? 'openai/gpt-4o-mini',
220
+ maxCostCents: safeNonNegativeInteger(cascade.drafterMaxCostCents ?? 25),
221
+ },
222
+ reviewer: {
223
+ model: safeLabel(cascade.reviewerModel) ?? 'anthropic/claude-sonnet-4-6',
224
+ maxCostCents: safeNonNegativeInteger(cascade.reviewerMaxCostCents ?? 75),
225
+ },
226
+ triggerFired: triggers,
227
+ reviewerVerdict: safeLabel(input.reviewerVerdict) ?? 'review_required',
228
+ };
229
+ }
230
+ function reviewerCascadeTriggers(input, opts) {
231
+ if (opts.reviewerCascade?.enabled === false)
232
+ return [];
233
+ const threshold = opts.reviewerCascade?.triggerThreshold ?? 0.55;
234
+ const triggers = [];
235
+ if (input.highRisk === true)
236
+ triggers.push('high_risk_action');
237
+ if (input.keywordRisk === true)
238
+ triggers.push('keyword_prefilter');
239
+ if (typeof input.highRiskClassifierScore === 'number' && input.highRiskClassifierScore >= threshold)
240
+ triggers.push(`risk_score_above:${threshold}`);
241
+ if (['conflict_check', 'document_summary', 'client_update_draft', 'send_client_email', 'trust_account_action'].includes(input.kind))
242
+ triggers.push('law_pack_default');
243
+ return [...new Set(triggers)].sort();
244
+ }
245
+ function capabilityForAction(kind) {
246
+ if (kind === 'trust_account_action')
247
+ return 'ADMIN';
248
+ if (kind === 'send_client_email' || kind === 'client_update_draft')
249
+ return 'TRANSACT';
250
+ return 'READ_ONLY';
251
+ }
252
+ function assertAction(input) {
253
+ assertPlainRecord(input, 'action');
254
+ if (!safeLabel(input.actionId))
255
+ throw new Error('Operating Pack actionId is required');
256
+ const allowedKinds = ['intake', 'conflict_check', 'document_summary', 'billing_reconciliation', 'client_update_draft', 'send_client_email', 'trust_account_action'];
257
+ if (!allowedKinds.includes(input.kind))
258
+ throw new Error('Operating Pack action kind is not supported');
259
+ if (input.capability && !(input.capability in CAPABILITY_RANK))
260
+ throw new Error('Operating Pack capability is not supported');
261
+ if (input.tokenCounts)
262
+ validateTokens(input.tokenCounts.inputTokens ?? 0, input.tokenCounts.outputTokens ?? 0);
263
+ if (input.totalCostCents != null && (!Number.isSafeInteger(input.totalCostCents) || input.totalCostCents < 0))
264
+ throw new Error('Operating Pack totalCostCents must be a non-negative safe integer');
265
+ }
266
+ function assertOperatingPackMetadataOnly(value, path = 'metadata') {
267
+ assertMetadataOnly(value, path);
268
+ }
269
+ function assertMetadataOnly(value, path = 'metadata') {
270
+ if (value == null)
271
+ return;
272
+ if (Array.isArray(value)) {
273
+ for (let i = 0; i < value.length; i++)
274
+ assertMetadataOnly(value[i], `${path}[${i}]`);
275
+ return;
276
+ }
277
+ if (typeof value !== 'object')
278
+ return;
279
+ for (const [key, child] of Object.entries(value)) {
280
+ if (DATA_PLANE_KEYS.test(key))
281
+ throw new Error(`Operating Pack metadata cannot include data-plane field: ${path}.${key}`);
282
+ assertMetadataOnly(child, `${path}.${key}`);
283
+ }
284
+ }
285
+ function filterReceiptMetadata(metadata) {
286
+ assertMetadataOnly(metadata);
287
+ const out = {};
288
+ for (const [key, value] of Object.entries(metadata)) {
289
+ if (!SAFE_METADATA_KEYS.has(key))
290
+ continue;
291
+ if (value == null || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean')
292
+ out[key] = value;
293
+ }
294
+ return out;
295
+ }
296
+ function assertPlainRecord(value, name) {
297
+ if (!value || typeof value !== 'object' || Array.isArray(value))
298
+ throw new Error(`Operating Pack ${name} must be an object`);
299
+ }
300
+ function validateTokens(inputTokens, outputTokens) {
301
+ if (!Number.isSafeInteger(inputTokens) || inputTokens < 0)
302
+ throw new Error('inputTokens must be a non-negative safe integer');
303
+ if (!Number.isSafeInteger(outputTokens) || outputTokens < 0)
304
+ throw new Error('outputTokens must be a non-negative safe integer');
305
+ }
306
+ function workflowHash(value) {
307
+ return hashValue(`workflow:${value}`);
308
+ }
309
+ function hashValue(value) {
310
+ return (0, decision_log_1.sha256Hex)((0, decision_log_1.canonicalJson)({ value }));
311
+ }
312
+ function safeLabel(value) {
313
+ if (typeof value !== 'string')
314
+ return undefined;
315
+ const trimmed = value.trim();
316
+ if (!trimmed || !/^[A-Za-z0-9_.:/-]{1,180}$/.test(trimmed))
317
+ return undefined;
318
+ return trimmed;
319
+ }
320
+ function safeModelIds(models) {
321
+ return models.map((model) => safeLabel(model)).filter(Boolean);
322
+ }
323
+ function safeNonNegativeInteger(value) {
324
+ return Number.isSafeInteger(value) && value >= 0 ? value : 0;
325
+ }
326
+ function operatingPackSignerFingerprint(opts) {
327
+ return opts.signingKeys ? (0, decision_log_1.computeSignerFingerprint)(opts.signingKeys.publicKey) : null;
328
+ }
329
+ //# sourceMappingURL=operating-pack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operating-pack.js","sourceRoot":"","sources":["../src/operating-pack.ts"],"names":[],"mappings":";;;AAwKA,kEAEC;AAqKD,0EAEC;AAyDD,wEAEC;AA5YD,mCAAoC;AACpC,iDAAoF;AACpF,wCAA0I;AA8E1I,MAAM,eAAe,GAA2C;IAC9D,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC;IACX,KAAK,EAAE,CAAC;IACR,WAAW,EAAE,CAAC;CACf,CAAC;AAEF,MAAM,eAAe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,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,IAAA,wBAAS,EAAC,IAAA,4BAAa,EAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7E,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,YAAY,CAAC,MAAgB;IACpC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAa,CAAC;AAC7E,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAc;IAC5C,OAAO,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAK,KAAgB,IAAI,CAAC,CAAC,CAAC,CAAC,KAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,SAAgB,8BAA8B,CAAC,IAA0B;IACvE,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAA,uCAAwB,EAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACxF,CAAC"}
package/dist/telemetry.js CHANGED
@@ -43,7 +43,7 @@ const https = __importStar(require("https"));
43
43
  const os = __importStar(require("os"));
44
44
  const path = __importStar(require("path"));
45
45
  const crypto_1 = require("crypto");
46
- const AGENTGUARD_SPEND_VERSION = '0.14.1';
46
+ const AGENTGUARD_SPEND_VERSION = '0.15.1';
47
47
  const STATE_DIR = path.join(os.homedir(), '.agentguard');
48
48
  const INSTALL_PATH = path.join(STATE_DIR, 'install.json');
49
49
  const BEACON_URL = 'https://agentguard.run/api/beacon';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentguard-run/spend",
3
- "version": "0.14.1",
3
+ "version": "0.15.1",
4
4
  "description": "All terminology and labels used in AgentGuard materials are descriptive of software functionality only, not legal definitions or guarantees of compliance. Terms like receipt, audit log, evidence, audit trail, and attestation refer solely to cryptographically-signed records produced by the software. Full functional-use disclaimer in README.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -109,6 +109,11 @@
109
109
  "types": "./dist/frameworks/openrouter.d.ts",
110
110
  "require": "./dist/frameworks/openrouter.js",
111
111
  "default": "./dist/frameworks/openrouter.js"
112
+ },
113
+ "./operating-pack": {
114
+ "types": "./dist/operating-pack.d.ts",
115
+ "require": "./dist/operating-pack.js",
116
+ "default": "./dist/operating-pack.js"
112
117
  }
113
118
  },
114
119
  "bin": {
@@ -142,7 +147,8 @@
142
147
  "src/byo",
143
148
  "src/cli/byo.ts",
144
149
  "docs/patents/CLAIM_MAPPING.md",
145
- "src/frameworks"
150
+ "src/frameworks",
151
+ "src/operating-pack.ts"
146
152
  ],
147
153
  "scripts": {
148
154
  "build": "tsc",
@@ -0,0 +1,397 @@
1
+ import { randomUUID } from 'crypto';
2
+ import { canonicalJson, computeSignerFingerprint, sha256Hex } from './decision-log';
3
+ import { signDagNode, verifyReceiptDag, type ReceiptCapabilityLevel, type ReceiptDagEnvelope, type ReceiptDagNode } from './receipts/dag';
4
+ import type { SpendDecision } from './types';
5
+
6
+ export type OperatingPackVertical = 'law';
7
+ export type OperatingPackActionKind =
8
+ | 'intake'
9
+ | 'conflict_check'
10
+ | 'document_summary'
11
+ | 'billing_reconciliation'
12
+ | 'client_update_draft'
13
+ | 'send_client_email'
14
+ | 'trust_account_action';
15
+
16
+ export interface OperatingPackSigningKeys {
17
+ privateKey: Uint8Array;
18
+ publicKey: Uint8Array;
19
+ }
20
+
21
+ export interface OperatingPackReviewerCascadeOptions {
22
+ enabled?: boolean;
23
+ drafterModel?: string;
24
+ reviewerModel?: string;
25
+ triggerThreshold?: number;
26
+ drafterMaxCostCents?: number;
27
+ reviewerMaxCostCents?: number;
28
+ }
29
+
30
+ export interface OperatingPackOptions {
31
+ vertical: OperatingPackVertical;
32
+ workflowId: string;
33
+ signingKeys: OperatingPackSigningKeys;
34
+ approvedCapabilities?: ReceiptCapabilityLevel[];
35
+ reviewerCascade?: OperatingPackReviewerCascadeOptions;
36
+ maxWorkflowCostCents?: number;
37
+ }
38
+
39
+ export interface OperatingPackAction {
40
+ actionId: string;
41
+ kind: OperatingPackActionKind;
42
+ capability?: ReceiptCapabilityLevel;
43
+ highRisk?: boolean;
44
+ highRiskClassifierScore?: number;
45
+ keywordRisk?: boolean;
46
+ modelIds?: string[];
47
+ tokenCounts?: { inputTokens?: number; outputTokens?: number };
48
+ totalCostCents?: number;
49
+ metadata?: Record<string, unknown>;
50
+ reviewerVerdict?: 'drafter_only' | 'review_required' | 'approved' | 'rejected';
51
+ }
52
+
53
+ export interface OperatingPackGuardResult {
54
+ allowed: boolean;
55
+ reason: string;
56
+ node: ReceiptDagNode;
57
+ dag: ReceiptDagEnvelope;
58
+ reviewerCascadeTriggered: boolean;
59
+ spentCents: number;
60
+ }
61
+
62
+ export interface OperatingPackSkillTemplate {
63
+ slug: string;
64
+ title: string;
65
+ capability: ReceiptCapabilityLevel;
66
+ reviewerCascade: boolean;
67
+ markdown: string;
68
+ }
69
+
70
+ export interface OperatingPackDefinition {
71
+ vertical: OperatingPackVertical;
72
+ title: string;
73
+ counselReviewPending: boolean;
74
+ agentsMd: string;
75
+ skills: Record<string, OperatingPackSkillTemplate>;
76
+ sourceOfTruth: string;
77
+ checklist: string[];
78
+ capabilityTable: Array<{ capability: ReceiptCapabilityLevel; use: string; blockedExamples: string[] }>;
79
+ }
80
+
81
+ const CAPABILITY_RANK: Record<ReceiptCapabilityLevel, number> = {
82
+ READ_ONLY: 0,
83
+ TRANSACT: 1,
84
+ ADMIN: 2,
85
+ ORCHESTRATE: 3,
86
+ };
87
+
88
+ const DATA_PLANE_KEYS = /^(title|summary|prompt|completion|content|messages|input|output|text|raw|source|notes|draft|body|transcript|document|client_content|clientContent|matter_description|email_body|file_text)$/i;
89
+ const SAFE_METADATA_KEYS = new Set([
90
+ 'action_id',
91
+ 'action_kind',
92
+ 'billing_code',
93
+ 'capability',
94
+ 'cost_cents',
95
+ 'duration_ms',
96
+ 'event',
97
+ 'jurisdiction',
98
+ 'matter_hash',
99
+ 'model',
100
+ 'model_id',
101
+ 'outcome',
102
+ 'practice_area',
103
+ 'review_status',
104
+ 'risk_score',
105
+ 'token_count',
106
+ 'workflow_id',
107
+ ]);
108
+
109
+ export const LAW_OPERATING_PACK: OperatingPackDefinition = {
110
+ vertical: 'law',
111
+ title: 'AgentGuard Law Operating Pack',
112
+ counselReviewPending: true,
113
+ agentsMd: `# AgentGuard Law Operating Pack\n\nCounsel review pending: this file is operating scaffolding for legal workflows and should be reviewed by your counsel before production use.\n\n## Guardrails\n\n- ABA Model Rule 1.6: protect client information. Do not paste client content into tools that are not approved for the matter.\n- Conflicts: run conflict checks before intake work advances to drafting or client communication.\n- No unauthorized practice of law: agents prepare drafts and metadata. A licensed attorney reviews legal judgment.\n- Draft before send: client-facing emails and filings are drafts until a human approves dispatch.\n- Retention: keep signed AgentGuard receipts and matter metadata according to firm policy. Do not store prompt or completion content in receipts.\n- Trust account actions: trust transfers, disbursement instructions, and ledger changes require ADMIN capability.\n\n## Capability Map\n\n- READ_ONLY: intake classification, conflict pre-checks, document summaries, billing reconciliation previews.\n- TRANSACT: create a client-update draft or prepare a dispatch packet.\n- ADMIN: trust-account actions, retention policy changes, capability changes.\n- ORCHESTRATE: assign or revoke agent work across matters.\n`,
114
+ skills: {
115
+ intake: {
116
+ slug: 'intake',
117
+ title: 'Intake Skill',
118
+ capability: 'READ_ONLY',
119
+ reviewerCascade: false,
120
+ markdown: `# Intake Skill\n\nPurpose: classify a new inquiry using matter metadata only.\n\nInputs: jurisdiction, practice area, referral source, matter hash, urgency flag.\n\nRules:\n- Do not ask the model to decide representation.\n- Do not place client narrative text in AgentGuard receipts.\n- Output a routing label, missing-information checklist, and conflict-check reminder.\n`,
121
+ },
122
+ 'conflict-check': {
123
+ slug: 'conflict-check',
124
+ title: 'Conflict Check Skill',
125
+ capability: 'READ_ONLY',
126
+ reviewerCascade: true,
127
+ markdown: `# Conflict Check Skill\n\nPurpose: prepare a conflict pre-check packet from firm metadata.\n\nInputs: matter hash, party hashes, jurisdiction, practice area, intake source.\n\nRules:\n- Match on firm-approved metadata systems only.\n- Refuse if party identity data is incomplete.\n- Reviewer Cascade triggers when a possible match, former-client marker, adverse-party marker, or trust-account marker appears.\n`,
128
+ },
129
+ 'document-summary': {
130
+ slug: 'document-summary',
131
+ title: 'Document Summary Skill',
132
+ capability: 'READ_ONLY',
133
+ reviewerCascade: true,
134
+ markdown: `# Document Summary Skill\n\nPurpose: produce a working summary for attorney review.\n\nInputs: document hash, document type, jurisdiction, matter hash, token counts.\n\nRules:\n- Cite document sections or refuse when citations are unavailable.\n- Mark all output as draft work product for attorney review.\n- Reviewer Cascade triggers for settlement, privilege, indemnity, non-compete, waiver, trust, sanctions, or deadline markers.\n`,
135
+ },
136
+ 'billing-reconciliation': {
137
+ slug: 'billing-reconciliation',
138
+ title: 'Billing Reconciliation Skill',
139
+ capability: 'READ_ONLY',
140
+ reviewerCascade: false,
141
+ markdown: `# Billing Reconciliation Skill\n\nPurpose: compare time-entry metadata against matter budgets and billing codes.\n\nInputs: billing code, matter hash, time-entry hashes, amount cents, policy cap.\n\nRules:\n- Do not move money.\n- Do not alter trust ledgers.\n- Escalate to ADMIN before any trust-account action.\n`,
142
+ },
143
+ 'client-update-draft': {
144
+ slug: 'client-update-draft',
145
+ title: 'Client Update Draft Skill',
146
+ capability: 'TRANSACT',
147
+ reviewerCascade: true,
148
+ markdown: `# Client Update Draft Skill\n\nPurpose: draft a client update for attorney review.\n\nInputs: matter hash, milestone label, jurisdiction, practice area, cited record hashes.\n\nRules:\n- Draft before send. Never dispatch directly.\n- Include a review status field before any client-facing use.\n- Reviewer Cascade triggers for deadline, settlement, privilege, fee, trust, or adverse-party markers.\n`,
149
+ },
150
+ },
151
+ sourceOfTruth: `# Source Of Truth Layout\n\nUse this local layout inside the firm environment.\n\n- matters/<matter-hash>/metadata.json\n- matters/<matter-hash>/parties.json\n- matters/<matter-hash>/documents/<document-hash>.json\n- matters/<matter-hash>/receipts/*.json\n- policies/agentguard-policy.yaml\n- logs/agentguard-decisions.ndjson\n\nAgentGuard receipts store metadata, hashes, costs, model identifiers, capability decisions, and signatures. They do not store prompt or completion content.\n`,
152
+ checklist: [
153
+ 'Review AGENTS.md with firm counsel before production use.',
154
+ 'Define matter hash and party hash conventions.',
155
+ 'Map each skill to a capability tier.',
156
+ 'Enable Reviewer Cascade for client updates, conflicts, and document summaries.',
157
+ 'Set a per-matter and per-day spend cap.',
158
+ 'Store signed receipts with matter metadata only.',
159
+ 'Test trust-account actions with ADMIN capability denied by default.',
160
+ ],
161
+ capabilityTable: [
162
+ { capability: 'READ_ONLY', use: 'Classify, summarize, reconcile, and prepare metadata-only packets.', blockedExamples: ['Sending client email', 'Trust ledger update'] },
163
+ { capability: 'TRANSACT', use: 'Create dispatch-ready drafts that still require human approval.', blockedExamples: ['Trust transfer', 'Policy change'] },
164
+ { capability: 'ADMIN', use: 'Trust-account actions, retention changes, and capability grants.', blockedExamples: ['Unreviewed client dispatch'] },
165
+ { capability: 'ORCHESTRATE', use: 'Assign, revoke, or coordinate multiple matter agents.', blockedExamples: ['Bypassing capability review'] },
166
+ ],
167
+ };
168
+
169
+ export function createOperatingPackEnvelope(opts: OperatingPackOptions): OperatingPackEnvelope {
170
+ return new OperatingPackEnvelope(opts);
171
+ }
172
+
173
+ export class OperatingPackEnvelope {
174
+ private readonly nodes: ReceiptDagNode[] = [];
175
+ private readonly approvedCapabilities: Set<ReceiptCapabilityLevel>;
176
+ private spentCents = 0;
177
+
178
+ constructor(private readonly opts: OperatingPackOptions) {
179
+ if (opts.vertical !== 'law') throw new Error('Only the law operating pack is bundled in this release');
180
+ if (!safeLabel(opts.workflowId)) throw new Error('Operating Pack workflowId is required');
181
+ this.approvedCapabilities = new Set(opts.approvedCapabilities ?? ['READ_ONLY']);
182
+ }
183
+
184
+ getPack(): OperatingPackDefinition {
185
+ return LAW_OPERATING_PACK;
186
+ }
187
+
188
+ async guardAction(input: OperatingPackAction): Promise<OperatingPackGuardResult> {
189
+ assertAction(input);
190
+ assertMetadataOnly(input.metadata ?? {});
191
+ const capability = input.capability ?? capabilityForAction(input.kind);
192
+ const cost = safeNonNegativeInteger(input.totalCostCents);
193
+ const spendExceeded = Number.isSafeInteger(this.opts.maxWorkflowCostCents) && this.opts.maxWorkflowCostCents! >= 0 && this.spentCents + cost > this.opts.maxWorkflowCostCents!;
194
+ const capabilityAllowed = this.hasCapability(capability);
195
+ const allowed = capabilityAllowed && !spendExceeded;
196
+ const reason = !capabilityAllowed ? `Capability ${capability} is required for ${input.kind}` : spendExceeded ? 'Operating Pack workflow spend cap reached' : 'Operating Pack action allowed';
197
+ if (allowed) this.spentCents += cost;
198
+ const triggers = allowed ? reviewerCascadeTriggers(input, this.opts) : [];
199
+ const node = await this.signActionNode(input, capability, allowed, reason, triggers);
200
+ this.nodes.push(node);
201
+ return {
202
+ allowed,
203
+ reason,
204
+ node,
205
+ dag: this.getReceiptDag(),
206
+ reviewerCascadeTriggered: triggers.length > 0,
207
+ spentCents: this.spentCents,
208
+ };
209
+ }
210
+
211
+ getReceiptDag(): ReceiptDagEnvelope {
212
+ const root = this.nodes[this.nodes.length - 1];
213
+ return { nodes: [...this.nodes], rootId: root?.entryHash ?? '0'.repeat(64), workflowId: workflowHash(this.opts.workflowId) };
214
+ }
215
+
216
+ async verifyDag(publicKeyHex?: string): Promise<Awaited<ReturnType<typeof verifyReceiptDag>>> {
217
+ return verifyReceiptDag(this.getReceiptDag(), publicKeyHex ?? Buffer.from(this.opts.signingKeys.publicKey).toString('hex'));
218
+ }
219
+
220
+ outboundPayloads(): Record<string, unknown>[] {
221
+ return [];
222
+ }
223
+
224
+ signerFingerprint(): string {
225
+ return computeSignerFingerprint(this.opts.signingKeys.publicKey);
226
+ }
227
+
228
+ private hasCapability(capability: ReceiptCapabilityLevel): boolean {
229
+ for (const granted of this.approvedCapabilities) {
230
+ if (CAPABILITY_RANK[granted] >= CAPABILITY_RANK[capability]) return true;
231
+ }
232
+ return false;
233
+ }
234
+
235
+ private async signActionNode(input: OperatingPackAction, capability: ReceiptCapabilityLevel, allowed: boolean, reason: string, triggers: string[]): Promise<ReceiptDagNode> {
236
+ const decision = operatingPackDecision(input, this.opts, capability, allowed, reason, triggers, this.spentCents);
237
+ return signDagNode({
238
+ sequence: this.nodes.length,
239
+ decision,
240
+ privateKey: this.opts.signingKeys.privateKey,
241
+ publicKey: this.opts.signingKeys.publicKey,
242
+ parents: this.nodes.length ? [this.nodes[this.nodes.length - 1] as ReceiptDagNode] : [],
243
+ workflowId: workflowHash(this.opts.workflowId),
244
+ trustScore: allowed ? (triggers.length ? 0.9 : 0.94) : 0.2,
245
+ blocked: !allowed,
246
+ capability,
247
+ });
248
+ }
249
+ }
250
+
251
+ function operatingPackDecision(input: OperatingPackAction, opts: OperatingPackOptions, capability: ReceiptCapabilityLevel, allowed: boolean, reason: string, triggers: string[], spentCents: number): SpendDecision {
252
+ const cost = safeNonNegativeInteger(input.totalCostCents);
253
+ const inputTokens = safeNonNegativeInteger(input.tokenCounts?.inputTokens);
254
+ const outputTokens = safeNonNegativeInteger(input.tokenCounts?.outputTokens);
255
+ const receipt: Record<string, unknown> = {
256
+ type: 'agent_operating_pack_action',
257
+ vertical: opts.vertical,
258
+ counselReviewPending: LAW_OPERATING_PACK.counselReviewPending,
259
+ workflowHash: workflowHash(opts.workflowId),
260
+ actionId: safeLabel(input.actionId) ?? hashValue(input.actionId).slice(0, 16),
261
+ actionKind: input.kind,
262
+ capability,
263
+ blocked: !allowed,
264
+ modelIds: safeModelIds(input.modelIds ?? []),
265
+ inputTokens,
266
+ outputTokens,
267
+ totalCostCents: cost,
268
+ metadata: filterReceiptMetadata({ ...(input.metadata ?? {}), action_kind: input.kind, capability }),
269
+ };
270
+ if (triggers.length > 0) receipt.reviewerCascade = buildReviewerCascadeReceipt(input, opts, triggers);
271
+ return {
272
+ decisionId: randomUUID(),
273
+ timestamp: new Date().toISOString(),
274
+ action: allowed ? 'allow' : 'block',
275
+ triggeredCap: allowed ? null : { window: 'per_call', amountCents: cost, action: 'block', reason },
276
+ triggeredScopeKey: null,
277
+ projectedCents: cost,
278
+ windowSpendBefore: Math.max(0, spentCents - (allowed ? cost : 0)),
279
+ windowSpendAfter: spentCents,
280
+ provider: 'unknown',
281
+ modelRequested: 'operating-pack',
282
+ modelResolved: 'operating-pack',
283
+ policyId: 'agentguard-operating-pack-law',
284
+ policyVersion: 1,
285
+ enforcementMode: 'enforce',
286
+ reasons: [reason],
287
+ entryType: 'outcome',
288
+ outcomeReceipt: receipt,
289
+ };
290
+ }
291
+
292
+ function buildReviewerCascadeReceipt(input: OperatingPackAction, opts: OperatingPackOptions, triggers: string[]): Record<string, unknown> {
293
+ const cascade = opts.reviewerCascade ?? {};
294
+ return {
295
+ outcome: input.kind,
296
+ drafter: {
297
+ model: safeLabel(cascade.drafterModel) ?? 'openai/gpt-4o-mini',
298
+ maxCostCents: safeNonNegativeInteger(cascade.drafterMaxCostCents ?? 25),
299
+ },
300
+ reviewer: {
301
+ model: safeLabel(cascade.reviewerModel) ?? 'anthropic/claude-sonnet-4-6',
302
+ maxCostCents: safeNonNegativeInteger(cascade.reviewerMaxCostCents ?? 75),
303
+ },
304
+ triggerFired: triggers,
305
+ reviewerVerdict: safeLabel(input.reviewerVerdict) ?? 'review_required',
306
+ };
307
+ }
308
+
309
+ function reviewerCascadeTriggers(input: OperatingPackAction, opts: OperatingPackOptions): string[] {
310
+ if (opts.reviewerCascade?.enabled === false) return [];
311
+ const threshold = opts.reviewerCascade?.triggerThreshold ?? 0.55;
312
+ const triggers: string[] = [];
313
+ if (input.highRisk === true) triggers.push('high_risk_action');
314
+ if (input.keywordRisk === true) triggers.push('keyword_prefilter');
315
+ if (typeof input.highRiskClassifierScore === 'number' && input.highRiskClassifierScore >= threshold) triggers.push(`risk_score_above:${threshold}`);
316
+ if (['conflict_check', 'document_summary', 'client_update_draft', 'send_client_email', 'trust_account_action'].includes(input.kind)) triggers.push('law_pack_default');
317
+ return [...new Set(triggers)].sort();
318
+ }
319
+
320
+ function capabilityForAction(kind: OperatingPackActionKind): ReceiptCapabilityLevel {
321
+ if (kind === 'trust_account_action') return 'ADMIN';
322
+ if (kind === 'send_client_email' || kind === 'client_update_draft') return 'TRANSACT';
323
+ return 'READ_ONLY';
324
+ }
325
+
326
+ function assertAction(input: OperatingPackAction): void {
327
+ assertPlainRecord(input, 'action');
328
+ if (!safeLabel(input.actionId)) throw new Error('Operating Pack actionId is required');
329
+ const allowedKinds: OperatingPackActionKind[] = ['intake', 'conflict_check', 'document_summary', 'billing_reconciliation', 'client_update_draft', 'send_client_email', 'trust_account_action'];
330
+ if (!allowedKinds.includes(input.kind)) throw new Error('Operating Pack action kind is not supported');
331
+ if (input.capability && !(input.capability in CAPABILITY_RANK)) throw new Error('Operating Pack capability is not supported');
332
+ if (input.tokenCounts) validateTokens(input.tokenCounts.inputTokens ?? 0, input.tokenCounts.outputTokens ?? 0);
333
+ if (input.totalCostCents != null && (!Number.isSafeInteger(input.totalCostCents) || input.totalCostCents < 0)) throw new Error('Operating Pack totalCostCents must be a non-negative safe integer');
334
+ }
335
+
336
+ export function assertOperatingPackMetadataOnly(value: unknown, path = 'metadata'): void {
337
+ assertMetadataOnly(value, path);
338
+ }
339
+
340
+ function assertMetadataOnly(value: unknown, path = 'metadata'): void {
341
+ if (value == null) return;
342
+ if (Array.isArray(value)) {
343
+ for (let i = 0; i < value.length; i++) assertMetadataOnly(value[i], `${path}[${i}]`);
344
+ return;
345
+ }
346
+ if (typeof value !== 'object') return;
347
+ for (const [key, child] of Object.entries(value as Record<string, unknown>)) {
348
+ if (DATA_PLANE_KEYS.test(key)) throw new Error(`Operating Pack metadata cannot include data-plane field: ${path}.${key}`);
349
+ assertMetadataOnly(child, `${path}.${key}`);
350
+ }
351
+ }
352
+
353
+ function filterReceiptMetadata(metadata: Record<string, unknown>): Record<string, unknown> {
354
+ assertMetadataOnly(metadata);
355
+ const out: Record<string, unknown> = {};
356
+ for (const [key, value] of Object.entries(metadata)) {
357
+ if (!SAFE_METADATA_KEYS.has(key)) continue;
358
+ if (value == null || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') out[key] = value;
359
+ }
360
+ return out;
361
+ }
362
+
363
+ function assertPlainRecord(value: unknown, name: string): void {
364
+ if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error(`Operating Pack ${name} must be an object`);
365
+ }
366
+
367
+ function validateTokens(inputTokens: number, outputTokens: number): void {
368
+ if (!Number.isSafeInteger(inputTokens) || inputTokens < 0) throw new Error('inputTokens must be a non-negative safe integer');
369
+ if (!Number.isSafeInteger(outputTokens) || outputTokens < 0) throw new Error('outputTokens must be a non-negative safe integer');
370
+ }
371
+
372
+ function workflowHash(value: string): string {
373
+ return hashValue(`workflow:${value}`);
374
+ }
375
+
376
+ function hashValue(value: string): string {
377
+ return sha256Hex(canonicalJson({ value }));
378
+ }
379
+
380
+ function safeLabel(value: unknown): string | undefined {
381
+ if (typeof value !== 'string') return undefined;
382
+ const trimmed = value.trim();
383
+ if (!trimmed || !/^[A-Za-z0-9_.:/-]{1,180}$/.test(trimmed)) return undefined;
384
+ return trimmed;
385
+ }
386
+
387
+ function safeModelIds(models: string[]): string[] {
388
+ return models.map((model) => safeLabel(model)).filter(Boolean) as string[];
389
+ }
390
+
391
+ function safeNonNegativeInteger(value: unknown): number {
392
+ return Number.isSafeInteger(value) && (value as number) >= 0 ? value as number : 0;
393
+ }
394
+
395
+ export function operatingPackSignerFingerprint(opts: OperatingPackOptions): string | null {
396
+ return opts.signingKeys ? computeSignerFingerprint(opts.signingKeys.publicKey) : null;
397
+ }