@atbash/sdk 0.14.1-dev.0 → 0.15.0-dev.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/dist/index.d.mts CHANGED
@@ -169,6 +169,11 @@ interface LogToolCallResult {
169
169
  }
170
170
  interface JudgeResult {
171
171
  verdict: Verdict;
172
+ /**
173
+ * Canonical executable permission, computed by `canonicalAllow` — see that
174
+ * function for the rule. Never more permissive than `auditToolCall`.
175
+ */
176
+ allow: boolean;
172
177
  actionType: string;
173
178
  reason: string;
174
179
  confidence: number;
@@ -197,6 +202,8 @@ interface JudgeResult {
197
202
  interface JudgmentStatus {
198
203
  status: JudgmentState;
199
204
  verdict: Verdict;
205
+ /** Same canonical executable permission as {@link JudgeResult.allow}. */
206
+ allow: boolean;
200
207
  reason: string;
201
208
  judgmentId: string;
202
209
  onChain?: boolean;
@@ -759,9 +766,25 @@ declare class HttpTransportError extends Error {
759
766
  });
760
767
  }
761
768
 
769
+ declare function canonicalAllow(data: Record<string, unknown>): boolean;
770
+
762
771
  /** Normalize wire shapes (verdict casing, status, pubkey) to canonical forms. */
763
772
 
764
773
  declare function normalizeVerdict(raw: unknown): Verdict;
774
+ /**
775
+ * Canonicalize `action_type` at the wire boundary, the way
776
+ * {@link normalizeVerdict} already canonicalizes `verdict`.
777
+ *
778
+ * `verdict` has been normalized here since the beginning and has never
779
+ * drifted between consumers. `action_type` was passed through raw, so every
780
+ * reader invented its own folding policy — `auditToolCall` compared exactly
781
+ * while `memory/scan.ts` trimmed and case-folded, and the same `" ALLOW "`
782
+ * was therefore an error on one path and permission on the other.
783
+ *
784
+ * Trim and case-fold only. Zero-width and homoglyph variants survive
785
+ * untouched, stay outside the known set, and still fail closed.
786
+ */
787
+ declare function normalizeActionType(raw: unknown): string;
765
788
  declare function normalizeStatus(raw: unknown): JudgmentState;
766
789
  /** Wire pubkey may be a hex string, a Buffer/Uint8Array, or `{ data: [...] }`. */
767
790
  declare function pubkeyToHex(val: unknown): string;
@@ -1486,4 +1509,4 @@ declare function containsSecret(text: string): boolean;
1486
1509
  declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
1487
1510
  declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
1488
1511
 
1489
- export { type ActionType, type AgentAuth, type AgentLookupOptions, type AgentMemoryEntry, type AgentPolicy, type AnomalySeverity, type AnomalyType, Atbash, AtbashAPIError, type AtbashLogger, type AtbashOptions, type AtbashUserConfig, BOOT_SYNC_HINT, type ChainConfig, type ChainOpts, type ClassifierToolContext, type ClassifierToolEvent, type ClassifyMemoryReadOptions, type ClassifyMemoryWriteOptions, type ClientSource, type CommitMemoryOptions, DEFAULT_BLOCKCHAIN_RID, DEFAULT_CHROMIA_NODE_URLS, DEFAULT_ENDPOINT, DEFAULT_MEMORY_PATH_PATTERNS, DEFAULT_MEMORY_READ_TOOL_NAMES, DEFAULT_MEMORY_WRITE_TOOL_NAMES, type Decision, type DecisionVerdict, EciesDomain, type EncryptedMemory, type Envelope, type FromConfigOptions, type GuardLogger, type GuardMemoryDecision, type GuardMemoryWriteInput, type GuardMemoryWriteResult, type HeldAction, type HeldActionReview, type HookDecision, HttpClient, HttpTransportError, type JudgeEndpointConfig, type JudgeOptions, type JudgeResult, type JudgmentState, type JudgmentStatus, KEY_FILENAMES, type KeyPair, type LogToolCallOptions, type LogToolCallResult, type MemoryAnomaly, type MemoryDiffResult, type MemoryEntry, MemoryGuardManager, type MemoryGuardManagerOptions, MemoryIntegrityError, type MemoryPointer, type MemoryRollbackEvent, type MemoryScanOptions, type MemoryScanResult, type MemoryScanVerdict, type MemorySnapshot, type ModifiedEntry, type Network, type OrgSubscription, PRIVATE_CHAIN, PUBLIC_CHAIN, PointerStore, type Provider, type PubkeyValue, type RedactResult, type RollbackMemoryOptions, type SecretKind, type SecretMatch, SignatureVerificationError, type Subscription, type SyncMemoryOptions, type SyncMemoryResult, type TelemetryConfig, type TierInfo, type ToolCallFull, type ToolCallInput, type ToolCallRecord, type ValidatedEndpoint, type Verdict, type WrappedLogger, bootSyncFailureLine, buildAllowedJudgeHosts, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, normalizeActionForHash, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, redactJsonStrings, redactSecrets, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
1512
+ export { type ActionType, type AgentAuth, type AgentLookupOptions, type AgentMemoryEntry, type AgentPolicy, type AnomalySeverity, type AnomalyType, Atbash, AtbashAPIError, type AtbashLogger, type AtbashOptions, type AtbashUserConfig, BOOT_SYNC_HINT, type ChainConfig, type ChainOpts, type ClassifierToolContext, type ClassifierToolEvent, type ClassifyMemoryReadOptions, type ClassifyMemoryWriteOptions, type ClientSource, type CommitMemoryOptions, DEFAULT_BLOCKCHAIN_RID, DEFAULT_CHROMIA_NODE_URLS, DEFAULT_ENDPOINT, DEFAULT_MEMORY_PATH_PATTERNS, DEFAULT_MEMORY_READ_TOOL_NAMES, DEFAULT_MEMORY_WRITE_TOOL_NAMES, type Decision, type DecisionVerdict, EciesDomain, type EncryptedMemory, type Envelope, type FromConfigOptions, type GuardLogger, type GuardMemoryDecision, type GuardMemoryWriteInput, type GuardMemoryWriteResult, type HeldAction, type HeldActionReview, type HookDecision, HttpClient, HttpTransportError, type JudgeEndpointConfig, type JudgeOptions, type JudgeResult, type JudgmentState, type JudgmentStatus, KEY_FILENAMES, type KeyPair, type LogToolCallOptions, type LogToolCallResult, type MemoryAnomaly, type MemoryDiffResult, type MemoryEntry, MemoryGuardManager, type MemoryGuardManagerOptions, MemoryIntegrityError, type MemoryPointer, type MemoryRollbackEvent, type MemoryScanOptions, type MemoryScanResult, type MemoryScanVerdict, type MemorySnapshot, type ModifiedEntry, type Network, type OrgSubscription, PRIVATE_CHAIN, PUBLIC_CHAIN, PointerStore, type Provider, type PubkeyValue, type RedactResult, type RollbackMemoryOptions, type SecretKind, type SecretMatch, SignatureVerificationError, type Subscription, type SyncMemoryOptions, type SyncMemoryResult, type TelemetryConfig, type TierInfo, type ToolCallFull, type ToolCallInput, type ToolCallRecord, type ValidatedEndpoint, type Verdict, type WrappedLogger, bootSyncFailureLine, buildAllowedJudgeHosts, canonicalAllow, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, redactJsonStrings, redactSecrets, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
package/dist/index.d.ts CHANGED
@@ -169,6 +169,11 @@ interface LogToolCallResult {
169
169
  }
170
170
  interface JudgeResult {
171
171
  verdict: Verdict;
172
+ /**
173
+ * Canonical executable permission, computed by `canonicalAllow` — see that
174
+ * function for the rule. Never more permissive than `auditToolCall`.
175
+ */
176
+ allow: boolean;
172
177
  actionType: string;
173
178
  reason: string;
174
179
  confidence: number;
@@ -197,6 +202,8 @@ interface JudgeResult {
197
202
  interface JudgmentStatus {
198
203
  status: JudgmentState;
199
204
  verdict: Verdict;
205
+ /** Same canonical executable permission as {@link JudgeResult.allow}. */
206
+ allow: boolean;
200
207
  reason: string;
201
208
  judgmentId: string;
202
209
  onChain?: boolean;
@@ -759,9 +766,25 @@ declare class HttpTransportError extends Error {
759
766
  });
760
767
  }
761
768
 
769
+ declare function canonicalAllow(data: Record<string, unknown>): boolean;
770
+
762
771
  /** Normalize wire shapes (verdict casing, status, pubkey) to canonical forms. */
763
772
 
764
773
  declare function normalizeVerdict(raw: unknown): Verdict;
774
+ /**
775
+ * Canonicalize `action_type` at the wire boundary, the way
776
+ * {@link normalizeVerdict} already canonicalizes `verdict`.
777
+ *
778
+ * `verdict` has been normalized here since the beginning and has never
779
+ * drifted between consumers. `action_type` was passed through raw, so every
780
+ * reader invented its own folding policy — `auditToolCall` compared exactly
781
+ * while `memory/scan.ts` trimmed and case-folded, and the same `" ALLOW "`
782
+ * was therefore an error on one path and permission on the other.
783
+ *
784
+ * Trim and case-fold only. Zero-width and homoglyph variants survive
785
+ * untouched, stay outside the known set, and still fail closed.
786
+ */
787
+ declare function normalizeActionType(raw: unknown): string;
765
788
  declare function normalizeStatus(raw: unknown): JudgmentState;
766
789
  /** Wire pubkey may be a hex string, a Buffer/Uint8Array, or `{ data: [...] }`. */
767
790
  declare function pubkeyToHex(val: unknown): string;
@@ -1486,4 +1509,4 @@ declare function containsSecret(text: string): boolean;
1486
1509
  declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
1487
1510
  declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
1488
1511
 
1489
- export { type ActionType, type AgentAuth, type AgentLookupOptions, type AgentMemoryEntry, type AgentPolicy, type AnomalySeverity, type AnomalyType, Atbash, AtbashAPIError, type AtbashLogger, type AtbashOptions, type AtbashUserConfig, BOOT_SYNC_HINT, type ChainConfig, type ChainOpts, type ClassifierToolContext, type ClassifierToolEvent, type ClassifyMemoryReadOptions, type ClassifyMemoryWriteOptions, type ClientSource, type CommitMemoryOptions, DEFAULT_BLOCKCHAIN_RID, DEFAULT_CHROMIA_NODE_URLS, DEFAULT_ENDPOINT, DEFAULT_MEMORY_PATH_PATTERNS, DEFAULT_MEMORY_READ_TOOL_NAMES, DEFAULT_MEMORY_WRITE_TOOL_NAMES, type Decision, type DecisionVerdict, EciesDomain, type EncryptedMemory, type Envelope, type FromConfigOptions, type GuardLogger, type GuardMemoryDecision, type GuardMemoryWriteInput, type GuardMemoryWriteResult, type HeldAction, type HeldActionReview, type HookDecision, HttpClient, HttpTransportError, type JudgeEndpointConfig, type JudgeOptions, type JudgeResult, type JudgmentState, type JudgmentStatus, KEY_FILENAMES, type KeyPair, type LogToolCallOptions, type LogToolCallResult, type MemoryAnomaly, type MemoryDiffResult, type MemoryEntry, MemoryGuardManager, type MemoryGuardManagerOptions, MemoryIntegrityError, type MemoryPointer, type MemoryRollbackEvent, type MemoryScanOptions, type MemoryScanResult, type MemoryScanVerdict, type MemorySnapshot, type ModifiedEntry, type Network, type OrgSubscription, PRIVATE_CHAIN, PUBLIC_CHAIN, PointerStore, type Provider, type PubkeyValue, type RedactResult, type RollbackMemoryOptions, type SecretKind, type SecretMatch, SignatureVerificationError, type Subscription, type SyncMemoryOptions, type SyncMemoryResult, type TelemetryConfig, type TierInfo, type ToolCallFull, type ToolCallInput, type ToolCallRecord, type ValidatedEndpoint, type Verdict, type WrappedLogger, bootSyncFailureLine, buildAllowedJudgeHosts, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, normalizeActionForHash, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, redactJsonStrings, redactSecrets, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
1512
+ export { type ActionType, type AgentAuth, type AgentLookupOptions, type AgentMemoryEntry, type AgentPolicy, type AnomalySeverity, type AnomalyType, Atbash, AtbashAPIError, type AtbashLogger, type AtbashOptions, type AtbashUserConfig, BOOT_SYNC_HINT, type ChainConfig, type ChainOpts, type ClassifierToolContext, type ClassifierToolEvent, type ClassifyMemoryReadOptions, type ClassifyMemoryWriteOptions, type ClientSource, type CommitMemoryOptions, DEFAULT_BLOCKCHAIN_RID, DEFAULT_CHROMIA_NODE_URLS, DEFAULT_ENDPOINT, DEFAULT_MEMORY_PATH_PATTERNS, DEFAULT_MEMORY_READ_TOOL_NAMES, DEFAULT_MEMORY_WRITE_TOOL_NAMES, type Decision, type DecisionVerdict, EciesDomain, type EncryptedMemory, type Envelope, type FromConfigOptions, type GuardLogger, type GuardMemoryDecision, type GuardMemoryWriteInput, type GuardMemoryWriteResult, type HeldAction, type HeldActionReview, type HookDecision, HttpClient, HttpTransportError, type JudgeEndpointConfig, type JudgeOptions, type JudgeResult, type JudgmentState, type JudgmentStatus, KEY_FILENAMES, type KeyPair, type LogToolCallOptions, type LogToolCallResult, type MemoryAnomaly, type MemoryDiffResult, type MemoryEntry, MemoryGuardManager, type MemoryGuardManagerOptions, MemoryIntegrityError, type MemoryPointer, type MemoryRollbackEvent, type MemoryScanOptions, type MemoryScanResult, type MemoryScanVerdict, type MemorySnapshot, type ModifiedEntry, type Network, type OrgSubscription, PRIVATE_CHAIN, PUBLIC_CHAIN, PointerStore, type Provider, type PubkeyValue, type RedactResult, type RollbackMemoryOptions, type SecretKind, type SecretMatch, SignatureVerificationError, type Subscription, type SyncMemoryOptions, type SyncMemoryResult, type TelemetryConfig, type TierInfo, type ToolCallFull, type ToolCallInput, type ToolCallRecord, type ValidatedEndpoint, type Verdict, type WrappedLogger, bootSyncFailureLine, buildAllowedJudgeHosts, canonicalAllow, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, redactJsonStrings, redactSecrets, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
package/dist/index.js CHANGED
@@ -2875,6 +2875,7 @@ __export(src_ts_exports, {
2875
2875
  SignatureVerificationError: () => SignatureVerificationError,
2876
2876
  bootSyncFailureLine: () => bootSyncFailureLine,
2877
2877
  buildAllowedJudgeHosts: () => buildAllowedJudgeHosts,
2878
+ canonicalAllow: () => canonicalAllow,
2878
2879
  chainForNetwork: () => chainForNetwork,
2879
2880
  chooseKeyPath: () => chooseKeyPath,
2880
2881
  claimHashHex: () => claimHashHex,
@@ -2916,6 +2917,7 @@ __export(src_ts_exports, {
2916
2917
  loadAgentFromFile: () => loadAgentFromFile,
2917
2918
  loadUserConfig: () => loadUserConfig,
2918
2919
  normalizeActionForHash: () => normalizeActionForHash,
2920
+ normalizeActionType: () => normalizeActionType,
2919
2921
  normalizeForMatching: () => normalizeForMatching,
2920
2922
  normalizeStatus: () => normalizeStatus,
2921
2923
  normalizeVerdict: () => normalizeVerdict,
@@ -3278,6 +3280,9 @@ function normalizeVerdict(raw2) {
3278
3280
  if (v === "BLOCK" || v === "RED") return "BLOCK";
3279
3281
  return "HOLD";
3280
3282
  }
3283
+ function normalizeActionType(raw2) {
3284
+ return typeof raw2 === "string" ? raw2.trim().toLowerCase() : "";
3285
+ }
3281
3286
  function normalizeStatus(raw2) {
3282
3287
  const s2 = String(raw2 ?? "").toLowerCase();
3283
3288
  if (s2 === "pending" || s2 === "answered" || s2 === "error") return s2;
@@ -3294,6 +3299,37 @@ function pubkeyToHex(val) {
3294
3299
  return "";
3295
3300
  }
3296
3301
 
3302
+ // src-ts/decision.ts
3303
+ function isRecord(value) {
3304
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3305
+ }
3306
+ function allowSignalsPermit(data) {
3307
+ const signals = [];
3308
+ if (Object.hasOwn(data, "allow")) signals.push(data.allow);
3309
+ if (isRecord(data.decision) && Object.hasOwn(data.decision, "allow")) {
3310
+ signals.push(data.decision.allow);
3311
+ }
3312
+ return signals.length === 0 || signals.every((value) => value === true);
3313
+ }
3314
+ function wireActionType(data) {
3315
+ if (data.action_type !== void 0)
3316
+ return normalizeActionType(data.action_type);
3317
+ return normalizeActionType(data.actionType);
3318
+ }
3319
+ function isAuditTier(data) {
3320
+ const absentVerdict = data.verdict === null || data.verdict === void 0;
3321
+ return absentVerdict && data.status === "logged";
3322
+ }
3323
+ function canonicalAllow(data) {
3324
+ if (!allowSignalsPermit(data)) return false;
3325
+ const actionType = wireActionType(data);
3326
+ if (actionType && actionType !== "allow") return false;
3327
+ if (isAuditTier(data)) return true;
3328
+ if (typeof data.verdict !== "string") return false;
3329
+ const verdict = data.verdict.trim().toUpperCase();
3330
+ return verdict === "ALLOW" || verdict === "GREEN";
3331
+ }
3332
+
3297
3333
  // src-ts/opentel/telemetry.ts
3298
3334
  var import_node_fs2 = require("fs");
3299
3335
  var import_node_os2 = require("os");
@@ -3606,7 +3642,10 @@ var Atbash = class _Atbash {
3606
3642
  getAuthHeaders: () => this.authHeaders()
3607
3643
  });
3608
3644
  } catch (err) {
3609
- this.logger.warn?.("[atbash] telemetry setup failed \u2014 continuing without metrics", { error: String(err) });
3645
+ this.logger.warn?.(
3646
+ "[atbash] telemetry setup failed \u2014 continuing without metrics",
3647
+ { error: String(err) }
3648
+ );
3610
3649
  }
3611
3650
  }
3612
3651
  /**
@@ -3821,7 +3860,10 @@ var Atbash = class _Atbash {
3821
3860
  this._chainCache.set(options.orgName, chain);
3822
3861
  chainOpts = { network: mapNetwork };
3823
3862
  } else if (!chainOpts?.blockchainRid) {
3824
- const resolved = await this.resolveChainFromMap(options.orgName, null);
3863
+ const resolved = await this.resolveChainFromMap(
3864
+ options.orgName,
3865
+ null
3866
+ );
3825
3867
  chainOpts = { ...chainOpts, network: resolved.network };
3826
3868
  }
3827
3869
  }
@@ -3896,7 +3938,8 @@ var Atbash = class _Atbash {
3896
3938
  const score = typeof rawScore === "number" && Number.isInteger(rawScore) && rawScore >= 1 && rawScore <= 10 ? rawScore : void 0;
3897
3939
  return {
3898
3940
  verdict: normalizeVerdict(data.verdict),
3899
- actionType: String(data.action_type ?? ""),
3941
+ allow: canonicalAllow(data),
3942
+ actionType: normalizeActionType(data.action_type),
3900
3943
  reason: String(data.reason ?? ""),
3901
3944
  confidence: Number(data.confidence ?? 0),
3902
3945
  provider: String(data.provider ?? ""),
@@ -4062,6 +4105,7 @@ var Atbash = class _Atbash {
4062
4105
  return {
4063
4106
  status: normalizeStatus(data.status),
4064
4107
  verdict: normalizeVerdict(data.verdict),
4108
+ allow: canonicalAllow(data),
4065
4109
  reason: String(data.reason ?? ""),
4066
4110
  judgmentId: String(data.judgmentId ?? judgmentId),
4067
4111
  onChain: optBool(data.onChain),
@@ -4121,7 +4165,7 @@ var Atbash = class _Atbash {
4121
4165
  { tool_call_id: toolCallId },
4122
4166
  await this.defaultOrgBrid()
4123
4167
  );
4124
- if (!isRecord(raw2)) return null;
4168
+ if (!isRecord2(raw2)) return null;
4125
4169
  return toToolCallFull(raw2);
4126
4170
  });
4127
4171
  }
@@ -4133,7 +4177,7 @@ var Atbash = class _Atbash {
4133
4177
  { org: orgName },
4134
4178
  brid
4135
4179
  );
4136
- if (!isRecord(raw2)) return null;
4180
+ if (!isRecord2(raw2)) return null;
4137
4181
  return {
4138
4182
  orgName: String(raw2.org_name ?? ""),
4139
4183
  tier: String(raw2.tier ?? ""),
@@ -4210,7 +4254,7 @@ var Atbash = class _Atbash {
4210
4254
  );
4211
4255
  await this.raiseIfError(resp);
4212
4256
  const data = await this.json(resp) ?? {};
4213
- if (isRecord(data.data)) return data.data;
4257
+ if (isRecord2(data.data)) return data.data;
4214
4258
  return data;
4215
4259
  });
4216
4260
  }
@@ -4226,7 +4270,7 @@ var Atbash = class _Atbash {
4226
4270
  if (network) params.network = network;
4227
4271
  const brid = network ? this.bridFromChainOpts({ network }) : void 0;
4228
4272
  const raw2 = await this.riskEngineGet("org-subscription", params, brid);
4229
- if (!isRecord(raw2)) return null;
4273
+ if (!isRecord2(raw2)) return null;
4230
4274
  return coerceOrgSubscription(raw2, orgName);
4231
4275
  });
4232
4276
  }
@@ -4432,7 +4476,7 @@ var Atbash = class _Atbash {
4432
4476
  }
4433
4477
  if (resp.status !== 200) throw await this.httpError(resp);
4434
4478
  const data = await this.json(resp);
4435
- return isRecord(data) ? data : {};
4479
+ return isRecord2(data) ? data : {};
4436
4480
  }
4437
4481
  async riskEngineRecords(action, params, brid) {
4438
4482
  const raw2 = await this.riskEngineGet(action, params, brid);
@@ -4499,14 +4543,11 @@ var Atbash = class _Atbash {
4499
4543
  transportError(err) {
4500
4544
  if (err instanceof HttpTransportError) {
4501
4545
  if (this.debug) {
4502
- this.logger.warn?.(
4503
- `[atbash] transport failed \u2014 kind=${err.kind}`,
4504
- {
4505
- kind: err.kind,
4506
- cause: err.cause instanceof Error ? err.cause.message : String(err.cause ?? ""),
4507
- endpoint: this.endpoint
4508
- }
4509
- );
4546
+ this.logger.warn?.(`[atbash] transport failed \u2014 kind=${err.kind}`, {
4547
+ kind: err.kind,
4548
+ cause: err.cause instanceof Error ? err.cause.message : String(err.cause ?? ""),
4549
+ endpoint: this.endpoint
4550
+ });
4510
4551
  }
4511
4552
  return new AtbashAPIError(0, err.message, "", this.endpoint);
4512
4553
  }
@@ -4604,7 +4645,7 @@ function coerceOrgSubscription(raw2, orgName) {
4604
4645
  is_active: Boolean(raw2.is_active)
4605
4646
  };
4606
4647
  }
4607
- function isRecord(v) {
4648
+ function isRecord2(v) {
4608
4649
  return typeof v === "object" && v !== null && !Array.isArray(v);
4609
4650
  }
4610
4651
  function optString(v) {
@@ -4743,7 +4784,7 @@ async function scanMemory(entry, auth, opts) {
4743
4784
  );
4744
4785
  }
4745
4786
  const KNOWN_ACTIONS = ["allow", "block", "hold_for_user_confirm"];
4746
- const action = result.actionType.trim().toLowerCase();
4787
+ const action = result.actionType;
4747
4788
  if (result.verdict !== "No verdict" && action !== "" && !KNOWN_ACTIONS.includes(action)) {
4748
4789
  throw new Error(
4749
4790
  `memory scan: unrecognized action_type from judge (${result.actionType})`
@@ -43746,6 +43787,7 @@ function diffMemorySnapshots(before, after) {
43746
43787
  SignatureVerificationError,
43747
43788
  bootSyncFailureLine,
43748
43789
  buildAllowedJudgeHosts,
43790
+ canonicalAllow,
43749
43791
  chainForNetwork,
43750
43792
  chooseKeyPath,
43751
43793
  claimHashHex,
@@ -43787,6 +43829,7 @@ function diffMemorySnapshots(before, after) {
43787
43829
  loadAgentFromFile,
43788
43830
  loadUserConfig,
43789
43831
  normalizeActionForHash,
43832
+ normalizeActionType,
43790
43833
  normalizeForMatching,
43791
43834
  normalizeStatus,
43792
43835
  normalizeVerdict,