@odingard/guardian-sdk 0.1.0 → 0.2.0
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 +252 -17
- package/dist/contracts.js +9865 -0
- package/dist/index.js +12976 -1787
- package/dist/public-catalog.v1.json +6915 -0
- package/dist-dts/catalog.d.ts +14 -0
- package/dist-dts/client.d.ts +51 -1
- package/dist-dts/contracts/action-pack.d.ts +464 -0
- package/dist-dts/contracts/action-registry.d.ts +91 -1
- package/dist-dts/contracts/action.d.ts +1408 -17
- package/dist-dts/contracts/agent-state.d.ts +386 -0
- package/dist-dts/contracts/approval.d.ts +224 -5
- package/dist-dts/contracts/assurance.d.ts +60 -0
- package/dist-dts/contracts/authority-graph.d.ts +294 -0
- package/dist-dts/contracts/authority-state.d.ts +17 -2
- package/dist-dts/contracts/authority.d.ts +31 -5
- package/dist-dts/contracts/billing.d.ts +32 -0
- package/dist-dts/contracts/calendar.d.ts +6 -6
- package/dist-dts/contracts/denial.d.ts +648 -0
- package/dist-dts/contracts/evidence.d.ts +73 -16
- package/dist-dts/contracts/execution.d.ts +449 -55
- package/dist-dts/contracts/identifiers.d.ts +16 -0
- package/dist-dts/contracts/index.d.ts +22 -0
- package/dist-dts/contracts/intent.d.ts +335 -0
- package/dist-dts/contracts/lineage.d.ts +218 -0
- package/dist-dts/contracts/local.d.ts +101 -0
- package/dist-dts/contracts/multi-principal.d.ts +292 -0
- package/dist-dts/contracts/multiparty.d.ts +169 -0
- package/dist-dts/contracts/obligation.d.ts +196 -0
- package/dist-dts/contracts/plan.d.ts +67 -0
- package/dist-dts/contracts/policy-simulation.d.ts +681 -0
- package/dist-dts/contracts/prerequisite.d.ts +147 -0
- package/dist-dts/contracts/protected-data.d.ts +67 -0
- package/dist-dts/contracts/receipt.d.ts +3126 -0
- package/dist-dts/contracts/resource-claims.d.ts +146 -0
- package/dist-dts/contracts/runtime.d.ts +111 -0
- package/dist-dts/contracts/safety-envelope.d.ts +287 -0
- package/dist-dts/contracts/sequence.d.ts +132 -0
- package/dist-dts/contracts/sources.d.ts +191 -0
- package/dist-dts/contracts/tools.d.ts +50 -5
- package/dist-dts/contracts/transaction.d.ts +360 -0
- package/dist-dts/contracts-entry.d.ts +1 -0
- package/dist-dts/embedded.d.ts +58 -0
- package/dist-dts/evidence/evidence.d.ts +25 -0
- package/dist-dts/evidence/receipt.d.ts +61 -0
- package/dist-dts/index.d.ts +5 -1
- package/dist-dts/lifecycle.d.ts +25 -0
- package/dist-dts/proposal.d.ts +16 -0
- package/dist-dts/receipts.d.ts +37 -0
- package/package.json +12 -6
- package/dist-dts/__tests__/client.test.d.ts +0 -1
|
@@ -0,0 +1,681 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type RecordedAuthorityEvaluationInput } from "./action.js";
|
|
3
|
+
import { type AuthorityDecision } from "./authority.js";
|
|
4
|
+
import { AgentIdSchema, CorrelationIdSchema, PrincipalIdSchema, RequestIdSchema, TenantIdSchema } from "./identifiers.js";
|
|
5
|
+
/**
|
|
6
|
+
* WO-030: guardian.policy_simulation.v1 — policy simulation, authority
|
|
7
|
+
* diff, blast radius, shadow authority and the declared mode lifecycle
|
|
8
|
+
* (GUA-AUTHORITY-OS-001 §48–52, §79, §88–89, K15).
|
|
9
|
+
*
|
|
10
|
+
* §48 — the simulator answers "what would this policy allow?" over
|
|
11
|
+
* recorded history, synthetic scenarios, or current agents/resources.
|
|
12
|
+
* Every scenario is a recorded evaluation input; the simulator runs the
|
|
13
|
+
* SAME kernel verdicts as the live path against it, deterministically.
|
|
14
|
+
* Simulation never mutates live state and never fabricates an approval.
|
|
15
|
+
*
|
|
16
|
+
* §49 — the authority diff compares baseline and candidate outcomes: the
|
|
17
|
+
* verdict-count deltas and the materialized newly-allowed and
|
|
18
|
+
* newly-denied action-class lists.
|
|
19
|
+
*
|
|
20
|
+
* §50 — blast radius reports, deterministically, which agents, resources,
|
|
21
|
+
* action classes, counterparties, money, protected data, delegation and
|
|
22
|
+
* runtime windows the candidate expands.
|
|
23
|
+
*
|
|
24
|
+
* §51 — OBSERVE shadow mode computes the SAME ALLOW/ASK/DENY verdict but
|
|
25
|
+
* does not alter execution; the computed outcome is recorded as
|
|
26
|
+
* would_allow / would_ask / would_deny. would_* is a RECORD field, never
|
|
27
|
+
* a fourth verdict.
|
|
28
|
+
*
|
|
29
|
+
* §52 — the declared lifecycle OBSERVE → WARN → ASK-HEAVY → ENFORCE moves
|
|
30
|
+
* one adjacent step per recorded transition. Transitions are
|
|
31
|
+
* authority-bound, never silent, and cannot skip a stage.
|
|
32
|
+
*
|
|
33
|
+
* Truthfulness: this contract claims deterministic simulation, diff,
|
|
34
|
+
* blast radius, shadow recording and a declared lifecycle only. It does
|
|
35
|
+
* not predict real-world outcomes and never replaces human approval.
|
|
36
|
+
*/
|
|
37
|
+
export declare const POLICY_SIMULATION_CONTRACT_SCHEMA = "guardian.policy_simulation.v1";
|
|
38
|
+
/**
|
|
39
|
+
* The declared shadow/lifecycle mode for an agent. Modes are ordered:
|
|
40
|
+
* a transition may only move one adjacent step and may never skip.
|
|
41
|
+
*/
|
|
42
|
+
export declare const AuthorityModeSchema: z.ZodEnum<{
|
|
43
|
+
observe: "observe";
|
|
44
|
+
warn: "warn";
|
|
45
|
+
ask_heavy: "ask_heavy";
|
|
46
|
+
enforce: "enforce";
|
|
47
|
+
}>;
|
|
48
|
+
export type AuthorityMode = z.infer<typeof AuthorityModeSchema>;
|
|
49
|
+
/** Declared lifecycle order; index distance defines adjacency. */
|
|
50
|
+
export declare const AUTHORITY_MODE_ORDER: readonly ["observe", "warn", "ask_heavy", "enforce"];
|
|
51
|
+
export declare const AuthorityModeTransitionSchema: z.ZodObject<{
|
|
52
|
+
fromMode: z.ZodEnum<{
|
|
53
|
+
observe: "observe";
|
|
54
|
+
warn: "warn";
|
|
55
|
+
ask_heavy: "ask_heavy";
|
|
56
|
+
enforce: "enforce";
|
|
57
|
+
}>;
|
|
58
|
+
toMode: z.ZodEnum<{
|
|
59
|
+
observe: "observe";
|
|
60
|
+
warn: "warn";
|
|
61
|
+
ask_heavy: "ask_heavy";
|
|
62
|
+
enforce: "enforce";
|
|
63
|
+
}>;
|
|
64
|
+
atEpochMs: z.ZodNumber;
|
|
65
|
+
actor: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
66
|
+
reason: z.ZodString;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
export type AuthorityModeTransition = z.infer<typeof AuthorityModeTransitionSchema>;
|
|
69
|
+
/** Recorded lifecycle state of one agent (tenant-scoped, CAS-versioned). */
|
|
70
|
+
export declare const AuthorityModeStateSchema: z.ZodObject<{
|
|
71
|
+
schema: z.ZodLiteral<"guardian.policy_simulation.v1">;
|
|
72
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
73
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
74
|
+
mode: z.ZodEnum<{
|
|
75
|
+
observe: "observe";
|
|
76
|
+
warn: "warn";
|
|
77
|
+
ask_heavy: "ask_heavy";
|
|
78
|
+
enforce: "enforce";
|
|
79
|
+
}>;
|
|
80
|
+
version: z.ZodNumber;
|
|
81
|
+
updatedBy: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
|
|
82
|
+
updatedAtEpochMs: z.ZodNumber;
|
|
83
|
+
lastTransition: z.ZodNullable<z.ZodObject<{
|
|
84
|
+
fromMode: z.ZodEnum<{
|
|
85
|
+
observe: "observe";
|
|
86
|
+
warn: "warn";
|
|
87
|
+
ask_heavy: "ask_heavy";
|
|
88
|
+
enforce: "enforce";
|
|
89
|
+
}>;
|
|
90
|
+
toMode: z.ZodEnum<{
|
|
91
|
+
observe: "observe";
|
|
92
|
+
warn: "warn";
|
|
93
|
+
ask_heavy: "ask_heavy";
|
|
94
|
+
enforce: "enforce";
|
|
95
|
+
}>;
|
|
96
|
+
atEpochMs: z.ZodNumber;
|
|
97
|
+
actor: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
98
|
+
reason: z.ZodString;
|
|
99
|
+
}, z.core.$strict>>;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
export type AuthorityModeState = z.infer<typeof AuthorityModeStateSchema>;
|
|
102
|
+
export declare const AuthorityModeCommandSchema: z.ZodObject<{
|
|
103
|
+
kind: z.ZodLiteral<"set_mode">;
|
|
104
|
+
mode: z.ZodEnum<{
|
|
105
|
+
observe: "observe";
|
|
106
|
+
warn: "warn";
|
|
107
|
+
ask_heavy: "ask_heavy";
|
|
108
|
+
enforce: "enforce";
|
|
109
|
+
}>;
|
|
110
|
+
actor: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
111
|
+
expectedVersion: z.ZodNumber;
|
|
112
|
+
reason: z.ZodString;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export type AuthorityModeCommand = z.infer<typeof AuthorityModeCommandSchema>;
|
|
115
|
+
/** The state a tenant's agents start in when no mode row exists. */
|
|
116
|
+
export declare function initialAuthorityModeState(input: {
|
|
117
|
+
tenantId: z.infer<typeof TenantIdSchema>;
|
|
118
|
+
agentId: z.infer<typeof AgentIdSchema>;
|
|
119
|
+
nowEpochMs: number;
|
|
120
|
+
}): AuthorityModeState;
|
|
121
|
+
/**
|
|
122
|
+
* CAS mode transition (§52): one adjacent step per command; a recorded
|
|
123
|
+
* transition is appended to the state and never silent. Same-mode is
|
|
124
|
+
* not a transition and is rejected.
|
|
125
|
+
*/
|
|
126
|
+
export declare function transitionAuthorityMode(recordInput: unknown, commandInput: unknown, nowEpochMs: number): {
|
|
127
|
+
ok: true;
|
|
128
|
+
record: AuthorityModeState;
|
|
129
|
+
} | {
|
|
130
|
+
ok: false;
|
|
131
|
+
reasonCode: "MALFORMED_RECORD" | "MALFORMED_COMMAND" | "STALE_VERSION" | "INVALID_TRANSITION";
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* A shadow verdict is what the kernel computed under OBSERVE/WARN — a
|
|
135
|
+
* record label, never a fourth AuthorityDecision.
|
|
136
|
+
*/
|
|
137
|
+
export declare const ShadowVerdictSchema: z.ZodEnum<{
|
|
138
|
+
would_allow: "would_allow";
|
|
139
|
+
would_ask: "would_ask";
|
|
140
|
+
would_deny: "would_deny";
|
|
141
|
+
}>;
|
|
142
|
+
export type ShadowVerdict = z.infer<typeof ShadowVerdictSchema>;
|
|
143
|
+
/** Maps the kernel verdict to its recorded shadow label. */
|
|
144
|
+
export declare function shadowVerdictFor(decision: AuthorityDecision["decision"]): ShadowVerdict;
|
|
145
|
+
/** Modes under which execution is unaltered and verdicts are recorded. */
|
|
146
|
+
export declare const SHADOW_MODES: readonly ["observe", "warn"];
|
|
147
|
+
/** Digest-bound record of what an observed request would have done. */
|
|
148
|
+
export declare const ShadowDecisionRecordSchema: z.ZodObject<{
|
|
149
|
+
schema: z.ZodLiteral<"guardian.policy_simulation.v1">;
|
|
150
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
151
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
152
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
153
|
+
requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
|
|
154
|
+
correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
|
|
155
|
+
actionDigest: z.ZodString;
|
|
156
|
+
mode: z.ZodEnum<{
|
|
157
|
+
observe: "observe";
|
|
158
|
+
warn: "warn";
|
|
159
|
+
}>;
|
|
160
|
+
verdict: z.ZodEnum<{
|
|
161
|
+
would_allow: "would_allow";
|
|
162
|
+
would_ask: "would_ask";
|
|
163
|
+
would_deny: "would_deny";
|
|
164
|
+
}>;
|
|
165
|
+
reasonCode: z.ZodString;
|
|
166
|
+
actionDecisionRecordDigest: z.ZodNullable<z.ZodString>;
|
|
167
|
+
decidedAtEpochMs: z.ZodNumber;
|
|
168
|
+
}, z.core.$strict>;
|
|
169
|
+
export type ShadowDecisionRecord = z.infer<typeof ShadowDecisionRecordSchema>;
|
|
170
|
+
export declare function shadowDecisionRecordDigest(record: ShadowDecisionRecord): string;
|
|
171
|
+
/**
|
|
172
|
+
* Builds the digest-bound shadow record for an OBSERVE/WARN issuance:
|
|
173
|
+
* what the kernel computed, bound to the live action and decision-record
|
|
174
|
+
* digests. The record never enters the verdict itself.
|
|
175
|
+
*/
|
|
176
|
+
export declare function createShadowDecisionRecord(input: {
|
|
177
|
+
tenantId: z.infer<typeof TenantIdSchema>;
|
|
178
|
+
principalId: z.infer<typeof PrincipalIdSchema>;
|
|
179
|
+
agentId: z.infer<typeof AgentIdSchema>;
|
|
180
|
+
requestId: z.infer<typeof RequestIdSchema>;
|
|
181
|
+
correlationId: z.infer<typeof CorrelationIdSchema>;
|
|
182
|
+
actionDigest: string;
|
|
183
|
+
mode: "observe" | "warn";
|
|
184
|
+
decision: AuthorityDecision;
|
|
185
|
+
actionDecisionRecordDigest: string | null;
|
|
186
|
+
decidedAtEpochMs: number;
|
|
187
|
+
}): ShadowDecisionRecord;
|
|
188
|
+
/**
|
|
189
|
+
* One simulation scenario: the recorded evaluation input the SAME kernel
|
|
190
|
+
* would evaluate live — recorded history replayed, a synthetic input, or
|
|
191
|
+
* a current agent/resource pair rebuilt by the caller.
|
|
192
|
+
*/
|
|
193
|
+
export declare const PolicyScenarioSchema: z.ZodObject<{
|
|
194
|
+
scenarioId: z.ZodString;
|
|
195
|
+
evaluationInput: z.ZodObject<{
|
|
196
|
+
nowEpochMs: z.ZodNumber;
|
|
197
|
+
principal: z.ZodObject<{
|
|
198
|
+
id: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
199
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
200
|
+
status: z.ZodEnum<{
|
|
201
|
+
active: "active";
|
|
202
|
+
disabled: "disabled";
|
|
203
|
+
}>;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
agent: z.ZodObject<{
|
|
206
|
+
id: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
207
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
208
|
+
ownerPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
209
|
+
status: z.ZodEnum<{
|
|
210
|
+
active: "active";
|
|
211
|
+
disabled: "disabled";
|
|
212
|
+
revoked: "revoked";
|
|
213
|
+
}>;
|
|
214
|
+
allowedInterfaces: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
215
|
+
mcp: "mcp";
|
|
216
|
+
rest: "rest";
|
|
217
|
+
internal: "internal";
|
|
218
|
+
}>>, z.ZodTransform<("mcp" | "rest" | "internal")[], ("mcp" | "rest" | "internal")[]>>;
|
|
219
|
+
boundRuntime: z.ZodOptional<z.ZodString>;
|
|
220
|
+
boundModel: z.ZodOptional<z.ZodString>;
|
|
221
|
+
parentAgentId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
request: z.ZodObject<{
|
|
224
|
+
id: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
|
|
225
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
226
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
227
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
228
|
+
action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
|
|
229
|
+
resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
|
|
230
|
+
interface: z.ZodEnum<{
|
|
231
|
+
mcp: "mcp";
|
|
232
|
+
rest: "rest";
|
|
233
|
+
internal: "internal";
|
|
234
|
+
}>;
|
|
235
|
+
requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
|
|
236
|
+
valueCents: z.ZodOptional<z.ZodNumber>;
|
|
237
|
+
uses: z.ZodNumber;
|
|
238
|
+
materialActionDigest: z.ZodOptional<z.ZodString>;
|
|
239
|
+
descriptiveContext: z.ZodOptional<z.ZodString>;
|
|
240
|
+
merchantId: z.ZodOptional<z.ZodString>;
|
|
241
|
+
merchantCategory: z.ZodOptional<z.ZodString>;
|
|
242
|
+
recurring: z.ZodOptional<z.ZodBoolean>;
|
|
243
|
+
taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
|
|
244
|
+
intentId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "IntentId", "out">>;
|
|
245
|
+
planId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "PlanId", "out">>;
|
|
246
|
+
}, z.core.$strict>;
|
|
247
|
+
policy: z.ZodObject<{
|
|
248
|
+
id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
|
|
249
|
+
version: z.ZodNumber;
|
|
250
|
+
}, z.core.$strict>;
|
|
251
|
+
authorityChain: z.ZodArray<z.ZodObject<{
|
|
252
|
+
id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
|
|
253
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
254
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
255
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
256
|
+
parentGrantId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
257
|
+
issuedBy: z.ZodObject<{
|
|
258
|
+
type: z.ZodLiteral<"principal">;
|
|
259
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
status: z.ZodEnum<{
|
|
262
|
+
active: "active";
|
|
263
|
+
disabled: "disabled";
|
|
264
|
+
revoked: "revoked";
|
|
265
|
+
}>;
|
|
266
|
+
version: z.ZodNumber;
|
|
267
|
+
delegable: z.ZodDefault<z.ZodBoolean>;
|
|
268
|
+
constraints: z.ZodObject<{
|
|
269
|
+
actions: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>, z.ZodTransform<(string & z.core.$brand<"ActionType">)[], (string & z.core.$brand<"ActionType">)[]>>;
|
|
270
|
+
resources: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">>, z.ZodTransform<(string & z.core.$brand<"ResourceRef">)[], (string & z.core.$brand<"ResourceRef">)[]>>;
|
|
271
|
+
adapterIds: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>;
|
|
272
|
+
maxValueCents: z.ZodOptional<z.ZodNumber>;
|
|
273
|
+
maxUsesPerRequest: z.ZodNumber;
|
|
274
|
+
notBeforeEpochMs: z.ZodOptional<z.ZodNumber>;
|
|
275
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
276
|
+
approvalRequired: z.ZodBoolean;
|
|
277
|
+
askAboveValueCents: z.ZodOptional<z.ZodNumber>;
|
|
278
|
+
merchantAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
279
|
+
categoryAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
280
|
+
recurrence: z.ZodOptional<z.ZodEnum<{
|
|
281
|
+
never: "never";
|
|
282
|
+
allowed: "allowed";
|
|
283
|
+
}>>;
|
|
284
|
+
budgetIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>, z.ZodTransform<(string & z.core.$brand<"BudgetId">)[], (string & z.core.$brand<"BudgetId">)[]>>>;
|
|
285
|
+
}, z.core.$strict>;
|
|
286
|
+
}, z.core.$strict>>;
|
|
287
|
+
revocations: z.ZodPipe<z.ZodArray<z.ZodObject<{
|
|
288
|
+
grantId: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
|
|
289
|
+
revokedAtEpochMs: z.ZodNumber;
|
|
290
|
+
reasonCode: z.ZodString;
|
|
291
|
+
}, z.core.$strict>>, z.ZodTransform<{
|
|
292
|
+
grantId: string & z.core.$brand<"GrantId">;
|
|
293
|
+
revokedAtEpochMs: number;
|
|
294
|
+
reasonCode: string;
|
|
295
|
+
}[], {
|
|
296
|
+
grantId: string & z.core.$brand<"GrantId">;
|
|
297
|
+
revokedAtEpochMs: number;
|
|
298
|
+
reasonCode: string;
|
|
299
|
+
}[]>>;
|
|
300
|
+
budgets: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
301
|
+
id: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
|
|
302
|
+
scope: z.ZodEnum<{
|
|
303
|
+
agent: "agent";
|
|
304
|
+
task: "task";
|
|
305
|
+
}>;
|
|
306
|
+
taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
|
|
307
|
+
limitCents: z.ZodNumber;
|
|
308
|
+
consumedCents: z.ZodNumber;
|
|
309
|
+
transactionLimit: z.ZodNumber;
|
|
310
|
+
consumedTransactions: z.ZodNumber;
|
|
311
|
+
expiresAtEpochMs: z.ZodOptional<z.ZodNumber>;
|
|
312
|
+
status: z.ZodEnum<{
|
|
313
|
+
active: "active";
|
|
314
|
+
exhausted: "exhausted";
|
|
315
|
+
revoked: "revoked";
|
|
316
|
+
}>;
|
|
317
|
+
}, z.core.$strict>>>, z.ZodTransform<{
|
|
318
|
+
id: string & z.core.$brand<"BudgetId">;
|
|
319
|
+
scope: "agent" | "task";
|
|
320
|
+
limitCents: number;
|
|
321
|
+
consumedCents: number;
|
|
322
|
+
transactionLimit: number;
|
|
323
|
+
consumedTransactions: number;
|
|
324
|
+
status: "active" | "exhausted" | "revoked";
|
|
325
|
+
taskId?: (string & z.core.$brand<"TaskId">) | undefined;
|
|
326
|
+
expiresAtEpochMs?: number | undefined;
|
|
327
|
+
}[], {
|
|
328
|
+
id: string & z.core.$brand<"BudgetId">;
|
|
329
|
+
scope: "agent" | "task";
|
|
330
|
+
limitCents: number;
|
|
331
|
+
consumedCents: number;
|
|
332
|
+
transactionLimit: number;
|
|
333
|
+
consumedTransactions: number;
|
|
334
|
+
status: "active" | "exhausted" | "revoked";
|
|
335
|
+
taskId?: (string & z.core.$brand<"TaskId">) | undefined;
|
|
336
|
+
expiresAtEpochMs?: number | undefined;
|
|
337
|
+
}[]>>;
|
|
338
|
+
pauses: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
339
|
+
id: z.core.$ZodBranded<z.ZodString, "PauseId", "out">;
|
|
340
|
+
scope: z.ZodEnum<{
|
|
341
|
+
agent: "agent";
|
|
342
|
+
principal: "principal";
|
|
343
|
+
grant: "grant";
|
|
344
|
+
connection: "connection";
|
|
345
|
+
}>;
|
|
346
|
+
agentId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>;
|
|
347
|
+
grantIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>, z.ZodTransform<(string & z.core.$brand<"GrantId">)[], (string & z.core.$brand<"GrantId">)[]>>>;
|
|
348
|
+
adapterIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>>;
|
|
349
|
+
}, z.core.$strict>>>, z.ZodTransform<{
|
|
350
|
+
id: string & z.core.$brand<"PauseId">;
|
|
351
|
+
scope: "agent" | "principal" | "grant" | "connection";
|
|
352
|
+
agentId?: (string & z.core.$brand<"AgentId">) | undefined;
|
|
353
|
+
grantIds?: (string & z.core.$brand<"GrantId">)[] | undefined;
|
|
354
|
+
adapterIds?: (string & z.core.$brand<"AdapterId">)[] | undefined;
|
|
355
|
+
}[], {
|
|
356
|
+
id: string & z.core.$brand<"PauseId">;
|
|
357
|
+
scope: "agent" | "principal" | "grant" | "connection";
|
|
358
|
+
agentId?: (string & z.core.$brand<"AgentId">) | undefined;
|
|
359
|
+
grantIds?: (string & z.core.$brand<"GrantId">)[] | undefined;
|
|
360
|
+
adapterIds?: (string & z.core.$brand<"AdapterId">)[] | undefined;
|
|
361
|
+
}[]>>;
|
|
362
|
+
}, z.core.$strict>;
|
|
363
|
+
}, z.core.$strict>;
|
|
364
|
+
export type PolicyScenario = z.infer<typeof PolicyScenarioSchema>;
|
|
365
|
+
/**
|
|
366
|
+
* The policy under test: a proposed policy reference and a declarative
|
|
367
|
+
* grant-set mutation applied to each scenario's authority chain. A human
|
|
368
|
+
* always activates policy; applying a candidate only ever changes a
|
|
369
|
+
* simulation input, never live state.
|
|
370
|
+
*/
|
|
371
|
+
export declare const PolicyCandidateSchema: z.ZodObject<{
|
|
372
|
+
policy: z.ZodOptional<z.ZodObject<{
|
|
373
|
+
id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
|
|
374
|
+
version: z.ZodNumber;
|
|
375
|
+
}, z.core.$strict>>;
|
|
376
|
+
upsertedGrants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
377
|
+
id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
|
|
378
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
379
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
380
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
381
|
+
parentGrantId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
382
|
+
issuedBy: z.ZodObject<{
|
|
383
|
+
type: z.ZodLiteral<"principal">;
|
|
384
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
385
|
+
}, z.core.$strict>;
|
|
386
|
+
status: z.ZodEnum<{
|
|
387
|
+
active: "active";
|
|
388
|
+
disabled: "disabled";
|
|
389
|
+
revoked: "revoked";
|
|
390
|
+
}>;
|
|
391
|
+
version: z.ZodNumber;
|
|
392
|
+
delegable: z.ZodDefault<z.ZodBoolean>;
|
|
393
|
+
constraints: z.ZodObject<{
|
|
394
|
+
actions: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>, z.ZodTransform<(string & z.core.$brand<"ActionType">)[], (string & z.core.$brand<"ActionType">)[]>>;
|
|
395
|
+
resources: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">>, z.ZodTransform<(string & z.core.$brand<"ResourceRef">)[], (string & z.core.$brand<"ResourceRef">)[]>>;
|
|
396
|
+
adapterIds: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>;
|
|
397
|
+
maxValueCents: z.ZodOptional<z.ZodNumber>;
|
|
398
|
+
maxUsesPerRequest: z.ZodNumber;
|
|
399
|
+
notBeforeEpochMs: z.ZodOptional<z.ZodNumber>;
|
|
400
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
401
|
+
approvalRequired: z.ZodBoolean;
|
|
402
|
+
askAboveValueCents: z.ZodOptional<z.ZodNumber>;
|
|
403
|
+
merchantAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
404
|
+
categoryAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
405
|
+
recurrence: z.ZodOptional<z.ZodEnum<{
|
|
406
|
+
never: "never";
|
|
407
|
+
allowed: "allowed";
|
|
408
|
+
}>>;
|
|
409
|
+
budgetIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>, z.ZodTransform<(string & z.core.$brand<"BudgetId">)[], (string & z.core.$brand<"BudgetId">)[]>>>;
|
|
410
|
+
}, z.core.$strict>;
|
|
411
|
+
}, z.core.$strict>>>;
|
|
412
|
+
removedGrantIds: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>>;
|
|
413
|
+
}, z.core.$strict>;
|
|
414
|
+
export type PolicyCandidate = z.infer<typeof PolicyCandidateSchema>;
|
|
415
|
+
/**
|
|
416
|
+
* Applies a candidate to an evaluation input: removed grant ids drop
|
|
417
|
+
* out, upserts replace same-id grants, remaining grants sort by id for
|
|
418
|
+
* determinism, and a proposed policy reference replaces the recorded one.
|
|
419
|
+
*/
|
|
420
|
+
export declare function applyPolicyCandidate(input: RecordedAuthorityEvaluationInput, candidateInput: unknown): RecordedAuthorityEvaluationInput;
|
|
421
|
+
/**
|
|
422
|
+
* ASK-HEAVY posture (§52): the declared transform narrows every chain
|
|
423
|
+
* grant to approval-required, so the SAME kernel naturally returns ASK
|
|
424
|
+
* for anything satisfiable — a declarative input change, never a kernel
|
|
425
|
+
* branch. The recorded evaluation input binds the transformed chain.
|
|
426
|
+
*/
|
|
427
|
+
export declare function applyAskHeavyPosture(input: RecordedAuthorityEvaluationInput): RecordedAuthorityEvaluationInput;
|
|
428
|
+
/** A live verdict as computed by the one kernel — three values only. */
|
|
429
|
+
export declare const SimulationVerdictSchema: z.ZodEnum<{
|
|
430
|
+
ALLOW: "ALLOW";
|
|
431
|
+
ASK: "ASK";
|
|
432
|
+
DENY: "DENY";
|
|
433
|
+
}>;
|
|
434
|
+
export type SimulationVerdict = z.infer<typeof SimulationVerdictSchema>;
|
|
435
|
+
export declare const SimulationOutcomeSchema: z.ZodObject<{
|
|
436
|
+
scenarioId: z.ZodString;
|
|
437
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
438
|
+
action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
|
|
439
|
+
resource: z.ZodString;
|
|
440
|
+
verdict: z.ZodEnum<{
|
|
441
|
+
ALLOW: "ALLOW";
|
|
442
|
+
ASK: "ASK";
|
|
443
|
+
DENY: "DENY";
|
|
444
|
+
}>;
|
|
445
|
+
reasonCode: z.ZodString;
|
|
446
|
+
}, z.core.$strict>;
|
|
447
|
+
export type SimulationOutcome = z.infer<typeof SimulationOutcomeSchema>;
|
|
448
|
+
export declare const AuthorityVerdictCountsSchema: z.ZodObject<{
|
|
449
|
+
allow: z.ZodNumber;
|
|
450
|
+
ask: z.ZodNumber;
|
|
451
|
+
deny: z.ZodNumber;
|
|
452
|
+
}, z.core.$strict>;
|
|
453
|
+
export type AuthorityVerdictCounts = z.infer<typeof AuthorityVerdictCountsSchema>;
|
|
454
|
+
export declare function countOutcomes(outcomes: readonly Pick<SimulationOutcome, "verdict">[]): AuthorityVerdictCounts;
|
|
455
|
+
export declare const AuthorityOutcomeChangeSchema: z.ZodObject<{
|
|
456
|
+
scenarioId: z.ZodString;
|
|
457
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
458
|
+
action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
|
|
459
|
+
previousVerdict: z.ZodEnum<{
|
|
460
|
+
ALLOW: "ALLOW";
|
|
461
|
+
ASK: "ASK";
|
|
462
|
+
DENY: "DENY";
|
|
463
|
+
}>;
|
|
464
|
+
proposedVerdict: z.ZodEnum<{
|
|
465
|
+
ALLOW: "ALLOW";
|
|
466
|
+
ASK: "ASK";
|
|
467
|
+
DENY: "DENY";
|
|
468
|
+
}>;
|
|
469
|
+
}, z.core.$strict>;
|
|
470
|
+
export type AuthorityOutcomeChange = z.infer<typeof AuthorityOutcomeChangeSchema>;
|
|
471
|
+
/**
|
|
472
|
+
* §49 diff: verdict-count deltas plus the materialized newly-allowed and
|
|
473
|
+
* newly-denied action classes (newly-asked materialized alongside).
|
|
474
|
+
*/
|
|
475
|
+
export declare const AuthorityDiffSchema: z.ZodObject<{
|
|
476
|
+
verdictDelta: z.ZodObject<{
|
|
477
|
+
allow: z.ZodNumber;
|
|
478
|
+
ask: z.ZodNumber;
|
|
479
|
+
deny: z.ZodNumber;
|
|
480
|
+
}, z.core.$strict>;
|
|
481
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
482
|
+
scenarioId: z.ZodString;
|
|
483
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
484
|
+
action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
|
|
485
|
+
previousVerdict: z.ZodEnum<{
|
|
486
|
+
ALLOW: "ALLOW";
|
|
487
|
+
ASK: "ASK";
|
|
488
|
+
DENY: "DENY";
|
|
489
|
+
}>;
|
|
490
|
+
proposedVerdict: z.ZodEnum<{
|
|
491
|
+
ALLOW: "ALLOW";
|
|
492
|
+
ASK: "ASK";
|
|
493
|
+
DENY: "DENY";
|
|
494
|
+
}>;
|
|
495
|
+
}, z.core.$strict>>;
|
|
496
|
+
newlyAllowedActionClasses: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
497
|
+
newlyDeniedActionClasses: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
498
|
+
newlyAskedActionClasses: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
499
|
+
}, z.core.$strict>;
|
|
500
|
+
export type AuthorityDiff = z.infer<typeof AuthorityDiffSchema>;
|
|
501
|
+
/**
|
|
502
|
+
* Matches baseline and proposed outcomes by scenarioId; a scenario absent
|
|
503
|
+
* from either side diffs against DENY-by-absence only for its own side —
|
|
504
|
+
* scenarios present on one side only still appear in `changes` when the
|
|
505
|
+
* present side's verdict differs from the other's.
|
|
506
|
+
*/
|
|
507
|
+
export declare function diffAuthorityOutcomes(previous: readonly SimulationOutcome[], proposed: readonly SimulationOutcome[]): AuthorityDiff;
|
|
508
|
+
/** Action classes treated as protected-data exposure in §50 reporting. */
|
|
509
|
+
export declare function isProtectedDataActionClass(action: string): boolean;
|
|
510
|
+
export declare const BlastRadiusSchema: z.ZodObject<{
|
|
511
|
+
agentsAffected: z.ZodArray<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>;
|
|
512
|
+
resourcesAffected: z.ZodArray<z.ZodString>;
|
|
513
|
+
newActionClasses: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
514
|
+
newCounterparties: z.ZodArray<z.ZodString>;
|
|
515
|
+
additionalMoneyExposureCents: z.ZodNumber;
|
|
516
|
+
additionalProtectedDataExposure: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
517
|
+
delegationExpansion: z.ZodObject<{
|
|
518
|
+
addedDelegableGrantIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
519
|
+
}, z.core.$strict>;
|
|
520
|
+
runtimeExpansion: z.ZodObject<{
|
|
521
|
+
widenedGrantIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
522
|
+
addedGrantIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
523
|
+
addedCoverageEpochMs: z.ZodNumber;
|
|
524
|
+
}, z.core.$strict>;
|
|
525
|
+
}, z.core.$strict>;
|
|
526
|
+
export type BlastRadius = z.infer<typeof BlastRadiusSchema>;
|
|
527
|
+
/**
|
|
528
|
+
* §50 blast radius, computed deterministically from the two outcome sets,
|
|
529
|
+
* the scenario inputs and the declared candidate. `nowEpochMs` bounds the
|
|
530
|
+
* coverage arithmetic for added grants without a notBefore.
|
|
531
|
+
*/
|
|
532
|
+
export declare function computeBlastRadius(input: {
|
|
533
|
+
baselineScenarios: readonly PolicyScenario[];
|
|
534
|
+
baselineOutcomes: readonly SimulationOutcome[];
|
|
535
|
+
proposedOutcomes: readonly SimulationOutcome[];
|
|
536
|
+
candidate: PolicyCandidate;
|
|
537
|
+
nowEpochMs: number;
|
|
538
|
+
}): BlastRadius;
|
|
539
|
+
export declare const SimulationRunIdSchema: z.ZodString;
|
|
540
|
+
export type SimulationRunId = z.infer<typeof SimulationRunIdSchema>;
|
|
541
|
+
/**
|
|
542
|
+
* The digest-bound run record a human reviews before activating policy:
|
|
543
|
+
* both outcome sets, the §49 diff and the §50 blast radius, bound to the
|
|
544
|
+
* candidate digest so consequences cannot be detached from the proposal.
|
|
545
|
+
*/
|
|
546
|
+
export declare const PolicySimulationRunSchema: z.ZodObject<{
|
|
547
|
+
schema: z.ZodLiteral<"guardian.policy_simulation.v1">;
|
|
548
|
+
runId: z.ZodString;
|
|
549
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
550
|
+
createdBy: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
551
|
+
createdAtEpochMs: z.ZodNumber;
|
|
552
|
+
scenarioDigests: z.ZodArray<z.ZodString>;
|
|
553
|
+
candidate: z.ZodObject<{
|
|
554
|
+
policy: z.ZodOptional<z.ZodObject<{
|
|
555
|
+
id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
|
|
556
|
+
version: z.ZodNumber;
|
|
557
|
+
}, z.core.$strict>>;
|
|
558
|
+
upsertedGrants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
559
|
+
id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
|
|
560
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
561
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
562
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
563
|
+
parentGrantId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
564
|
+
issuedBy: z.ZodObject<{
|
|
565
|
+
type: z.ZodLiteral<"principal">;
|
|
566
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
567
|
+
}, z.core.$strict>;
|
|
568
|
+
status: z.ZodEnum<{
|
|
569
|
+
active: "active";
|
|
570
|
+
disabled: "disabled";
|
|
571
|
+
revoked: "revoked";
|
|
572
|
+
}>;
|
|
573
|
+
version: z.ZodNumber;
|
|
574
|
+
delegable: z.ZodDefault<z.ZodBoolean>;
|
|
575
|
+
constraints: z.ZodObject<{
|
|
576
|
+
actions: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>, z.ZodTransform<(string & z.core.$brand<"ActionType">)[], (string & z.core.$brand<"ActionType">)[]>>;
|
|
577
|
+
resources: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">>, z.ZodTransform<(string & z.core.$brand<"ResourceRef">)[], (string & z.core.$brand<"ResourceRef">)[]>>;
|
|
578
|
+
adapterIds: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>;
|
|
579
|
+
maxValueCents: z.ZodOptional<z.ZodNumber>;
|
|
580
|
+
maxUsesPerRequest: z.ZodNumber;
|
|
581
|
+
notBeforeEpochMs: z.ZodOptional<z.ZodNumber>;
|
|
582
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
583
|
+
approvalRequired: z.ZodBoolean;
|
|
584
|
+
askAboveValueCents: z.ZodOptional<z.ZodNumber>;
|
|
585
|
+
merchantAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
586
|
+
categoryAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
587
|
+
recurrence: z.ZodOptional<z.ZodEnum<{
|
|
588
|
+
never: "never";
|
|
589
|
+
allowed: "allowed";
|
|
590
|
+
}>>;
|
|
591
|
+
budgetIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>, z.ZodTransform<(string & z.core.$brand<"BudgetId">)[], (string & z.core.$brand<"BudgetId">)[]>>>;
|
|
592
|
+
}, z.core.$strict>;
|
|
593
|
+
}, z.core.$strict>>>;
|
|
594
|
+
removedGrantIds: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>>;
|
|
595
|
+
}, z.core.$strict>;
|
|
596
|
+
candidateDigest: z.ZodString;
|
|
597
|
+
baseline: z.ZodObject<{
|
|
598
|
+
counts: z.ZodObject<{
|
|
599
|
+
allow: z.ZodNumber;
|
|
600
|
+
ask: z.ZodNumber;
|
|
601
|
+
deny: z.ZodNumber;
|
|
602
|
+
}, z.core.$strict>;
|
|
603
|
+
outcomes: z.ZodArray<z.ZodObject<{
|
|
604
|
+
scenarioId: z.ZodString;
|
|
605
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
606
|
+
action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
|
|
607
|
+
resource: z.ZodString;
|
|
608
|
+
verdict: z.ZodEnum<{
|
|
609
|
+
ALLOW: "ALLOW";
|
|
610
|
+
ASK: "ASK";
|
|
611
|
+
DENY: "DENY";
|
|
612
|
+
}>;
|
|
613
|
+
reasonCode: z.ZodString;
|
|
614
|
+
}, z.core.$strict>>;
|
|
615
|
+
}, z.core.$strict>;
|
|
616
|
+
proposed: z.ZodObject<{
|
|
617
|
+
counts: z.ZodObject<{
|
|
618
|
+
allow: z.ZodNumber;
|
|
619
|
+
ask: z.ZodNumber;
|
|
620
|
+
deny: z.ZodNumber;
|
|
621
|
+
}, z.core.$strict>;
|
|
622
|
+
outcomes: z.ZodArray<z.ZodObject<{
|
|
623
|
+
scenarioId: z.ZodString;
|
|
624
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
625
|
+
action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
|
|
626
|
+
resource: z.ZodString;
|
|
627
|
+
verdict: z.ZodEnum<{
|
|
628
|
+
ALLOW: "ALLOW";
|
|
629
|
+
ASK: "ASK";
|
|
630
|
+
DENY: "DENY";
|
|
631
|
+
}>;
|
|
632
|
+
reasonCode: z.ZodString;
|
|
633
|
+
}, z.core.$strict>>;
|
|
634
|
+
}, z.core.$strict>;
|
|
635
|
+
diff: z.ZodObject<{
|
|
636
|
+
verdictDelta: z.ZodObject<{
|
|
637
|
+
allow: z.ZodNumber;
|
|
638
|
+
ask: z.ZodNumber;
|
|
639
|
+
deny: z.ZodNumber;
|
|
640
|
+
}, z.core.$strict>;
|
|
641
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
642
|
+
scenarioId: z.ZodString;
|
|
643
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
644
|
+
action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
|
|
645
|
+
previousVerdict: z.ZodEnum<{
|
|
646
|
+
ALLOW: "ALLOW";
|
|
647
|
+
ASK: "ASK";
|
|
648
|
+
DENY: "DENY";
|
|
649
|
+
}>;
|
|
650
|
+
proposedVerdict: z.ZodEnum<{
|
|
651
|
+
ALLOW: "ALLOW";
|
|
652
|
+
ASK: "ASK";
|
|
653
|
+
DENY: "DENY";
|
|
654
|
+
}>;
|
|
655
|
+
}, z.core.$strict>>;
|
|
656
|
+
newlyAllowedActionClasses: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
657
|
+
newlyDeniedActionClasses: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
658
|
+
newlyAskedActionClasses: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
659
|
+
}, z.core.$strict>;
|
|
660
|
+
blastRadius: z.ZodObject<{
|
|
661
|
+
agentsAffected: z.ZodArray<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>;
|
|
662
|
+
resourcesAffected: z.ZodArray<z.ZodString>;
|
|
663
|
+
newActionClasses: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
664
|
+
newCounterparties: z.ZodArray<z.ZodString>;
|
|
665
|
+
additionalMoneyExposureCents: z.ZodNumber;
|
|
666
|
+
additionalProtectedDataExposure: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>;
|
|
667
|
+
delegationExpansion: z.ZodObject<{
|
|
668
|
+
addedDelegableGrantIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
669
|
+
}, z.core.$strict>;
|
|
670
|
+
runtimeExpansion: z.ZodObject<{
|
|
671
|
+
widenedGrantIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
672
|
+
addedGrantIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
673
|
+
addedCoverageEpochMs: z.ZodNumber;
|
|
674
|
+
}, z.core.$strict>;
|
|
675
|
+
}, z.core.$strict>;
|
|
676
|
+
runDigest: z.ZodString;
|
|
677
|
+
}, z.core.$strict>;
|
|
678
|
+
export type PolicySimulationRun = z.infer<typeof PolicySimulationRunSchema>;
|
|
679
|
+
export declare function policySimulationRunDigest(run: Omit<PolicySimulationRun, "runDigest">): string;
|
|
680
|
+
export declare function policyCandidateDigest(candidate: PolicyCandidate): string;
|
|
681
|
+
export declare function policyScenarioDigest(scenario: PolicyScenario): string;
|