@atbash/cli 0.3.9-dev.11 → 0.3.9-dev.13

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.
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atbash/cli",
3
- "version": "0.3.9-dev.11",
3
+ "version": "0.3.9-dev.13",
4
4
  "description": "Atbash CLI — control boundary before the last irreversible step in an agent workflow",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://atbash.ai",
@@ -14,13 +14,13 @@
14
14
  "LICENSE"
15
15
  ],
16
16
  "scripts": {
17
- "build": "tsc",
17
+ "build": "rm -rf dist && tsc",
18
18
  "dev": "ts-node src/bin/atbash.ts",
19
19
  "release": "npm version patch --no-git-tag-version && npm run build && npx npm@10 publish --access public",
20
20
  "release:dev": "npm version prerelease --preid dev --no-git-tag-version && npm run build && npm publish --tag dev"
21
21
  },
22
22
  "dependencies": {
23
- "@atbash/sdk": "0.3.11-dev.8",
23
+ "@atbash/sdk": "0.3.11-dev.9",
24
24
  "chalk": "^4.1.2",
25
25
  "commander": "^12.0.0",
26
26
  "omelette": "^0.4.17",
package/dist/client.d.ts DELETED
@@ -1,118 +0,0 @@
1
- export declare const DEFAULT_ENDPOINT = "https://atbash.ai";
2
- export declare const DEFAULT_CHROMIA_NODE_URLS: string[];
3
- export declare const DEFAULT_BLOCKCHAIN_RID = "25B41DF620C489349C54944496FF5C6E58CFCEFED0C51658780B67299D40E8ED";
4
- export declare function isValidPrivateKey(hex: string): boolean;
5
- export declare function derivePublicKey(privKeyHex: string): string;
6
- export declare function generateKeyPair(): {
7
- privKey: string;
8
- pubKey: string;
9
- };
10
- export interface AgentAuth {
11
- pubkey: string;
12
- privkey: string;
13
- }
14
- export declare function toPubkeyHex(val: unknown): string;
15
- export interface ClientOpts {
16
- endpoint?: string;
17
- timeout?: number;
18
- }
19
- export declare function logToolCall(action: string, context: string, auth: AgentAuth, extra?: {
20
- toolName?: string;
21
- toolArgsJson?: string;
22
- }, blockchainRid?: string): Promise<string>;
23
- export interface JudgeResult {
24
- verdict: string;
25
- action_type: string;
26
- reason: string;
27
- confidence: number;
28
- provider: string;
29
- latency_ms: number;
30
- tool_call_id: string;
31
- on_chain: boolean;
32
- }
33
- export interface TierInfo {
34
- org_name: string;
35
- tier: string;
36
- verdict_enabled: boolean;
37
- enforcement_enabled: boolean;
38
- }
39
- export interface ToolCallRecord {
40
- tool_call_id: string;
41
- agent_pubkey: unknown;
42
- tool_name: string;
43
- command_text: string;
44
- tool_args_json: string;
45
- context_text: string;
46
- org_name: string;
47
- rowid: number;
48
- }
49
- export interface ToolCallFull {
50
- tool_call_id: string;
51
- agent_pubkey: unknown;
52
- tool_name: string;
53
- command_text: string;
54
- context_text: string;
55
- tool_args_json?: string;
56
- org_name: string;
57
- created_at?: number;
58
- action_type?: string;
59
- result_status?: string;
60
- verdict_color?: string;
61
- verdict_reason?: string;
62
- verdict_source?: string;
63
- verdict_response_time_ms?: number;
64
- }
65
- export interface HeldAction {
66
- judgment_id: string;
67
- agent_pubkey: unknown;
68
- action_text: string;
69
- action_context: string;
70
- verdict: string;
71
- reason: string;
72
- created_at: number;
73
- }
74
- export interface HeldActionReview {
75
- judgment_id: string;
76
- action_text: string;
77
- status: string;
78
- review_note: string;
79
- reviewed_by: unknown;
80
- reviewed_at: number;
81
- created_at: number;
82
- }
83
- export interface JudgmentStatus {
84
- status: "pending" | "answered" | "error";
85
- verdict: string;
86
- reason: string;
87
- judgmentId: string;
88
- onChain?: boolean;
89
- cached?: boolean;
90
- responseTimeMs?: number;
91
- }
92
- export interface JudgeOptions extends ClientOpts {
93
- provider?: string;
94
- apiKey?: string;
95
- providerEndpoint?: string;
96
- model?: string;
97
- toolName?: string;
98
- toolArgsJson?: string;
99
- blockchainRid?: string;
100
- }
101
- export declare function judgeAction(action: string, context: string, auth: AgentAuth, opts?: JudgeOptions): Promise<JudgeResult>;
102
- export declare function getJudgmentStatus(judgmentId: string, opts?: ClientOpts): Promise<JudgmentStatus>;
103
- export declare function getToolCalls(maxCount: number, opts?: ClientOpts): Promise<ToolCallRecord[]>;
104
- export declare function getOrgToolCalls(orgName: string, maxCount: number, opts?: ClientOpts): Promise<ToolCallRecord[]>;
105
- export declare function getAgentToolCalls(agentPubkey: string, maxCount: number, opts?: ClientOpts): Promise<ToolCallRecord[]>;
106
- export declare function getToolCallCount(opts?: ClientOpts): Promise<number>;
107
- export declare function getToolCallFull(toolCallId: string, opts?: ClientOpts): Promise<ToolCallFull | null>;
108
- export declare function getOrgTierInfo(orgName: string, opts?: ClientOpts): Promise<TierInfo | null>;
109
- export declare function getPendingHeldActions(orgName: string, maxCount: number, opts?: ClientOpts): Promise<HeldAction[]>;
110
- export declare function getHeldActionReviews(orgName: string, maxCount: number, opts?: ClientOpts): Promise<HeldActionReview[]>;
111
- export declare function getAgentDetail(agentPubkey: string, opts?: ClientOpts): Promise<Record<string, unknown>>;
112
- export declare function getAgentPolicy(agentPubkey: string, opts?: ClientOpts): Promise<{
113
- policy: string;
114
- is_jailed: boolean;
115
- is_custom: boolean;
116
- default_policy: string;
117
- }>;
118
- export declare function getSafetyStats(opts?: ClientOpts): Promise<Record<string, unknown>>;
package/dist/client.js DELETED
@@ -1,217 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_BLOCKCHAIN_RID = exports.DEFAULT_CHROMIA_NODE_URLS = exports.DEFAULT_ENDPOINT = void 0;
4
- exports.isValidPrivateKey = isValidPrivateKey;
5
- exports.derivePublicKey = derivePublicKey;
6
- exports.generateKeyPair = generateKeyPair;
7
- exports.toPubkeyHex = toPubkeyHex;
8
- exports.logToolCall = logToolCall;
9
- exports.judgeAction = judgeAction;
10
- exports.getJudgmentStatus = getJudgmentStatus;
11
- exports.getToolCalls = getToolCalls;
12
- exports.getOrgToolCalls = getOrgToolCalls;
13
- exports.getAgentToolCalls = getAgentToolCalls;
14
- exports.getToolCallCount = getToolCallCount;
15
- exports.getToolCallFull = getToolCallFull;
16
- exports.getOrgTierInfo = getOrgTierInfo;
17
- exports.getPendingHeldActions = getPendingHeldActions;
18
- exports.getHeldActionReviews = getHeldActionReviews;
19
- exports.getAgentDetail = getAgentDetail;
20
- exports.getAgentPolicy = getAgentPolicy;
21
- exports.getSafetyStats = getSafetyStats;
22
- const crypto_1 = require("crypto");
23
- const postchain_client_1 = require("postchain-client");
24
- exports.DEFAULT_ENDPOINT = "https://atbash.ai";
25
- exports.DEFAULT_CHROMIA_NODE_URLS = [
26
- "https://node6.testnet.chromia.com:7740",
27
- "https://node7.testnet.chromia.com:7740",
28
- "https://node8.testnet.chromia.com:7740",
29
- ];
30
- exports.DEFAULT_BLOCKCHAIN_RID = "25B41DF620C489349C54944496FF5C6E58CFCEFED0C51658780B67299D40E8ED";
31
- function isValidPrivateKey(hex) {
32
- return /^[0-9a-fA-F]{64}$/.test(hex);
33
- }
34
- function derivePublicKey(privKeyHex) {
35
- const ecdh = (0, crypto_1.createECDH)("secp256k1");
36
- ecdh.setPrivateKey(Buffer.from(privKeyHex, "hex"));
37
- return ecdh.getPublicKey("hex", "compressed");
38
- }
39
- function generateKeyPair() {
40
- const ecdh = (0, crypto_1.createECDH)("secp256k1");
41
- ecdh.generateKeys();
42
- return {
43
- privKey: ecdh.getPrivateKey("hex"),
44
- pubKey: ecdh.getPublicKey("hex", "compressed"),
45
- };
46
- }
47
- function toPubkeyHex(val) {
48
- if (!val)
49
- return "";
50
- if (typeof val === "string")
51
- return val;
52
- if (Buffer.isBuffer(val))
53
- return val.toString("hex");
54
- if (typeof val === "object" && val !== null && "data" in val) {
55
- return Buffer.from(val.data).toString("hex");
56
- }
57
- return "";
58
- }
59
- function baseUrl(opts) {
60
- return opts?.endpoint || exports.DEFAULT_ENDPOINT;
61
- }
62
- function generateToolCallId() {
63
- const ts = Date.now();
64
- const rand = (0, crypto_1.randomBytes)(4).toString("hex");
65
- return `tc-${ts}-${rand}`;
66
- }
67
- async function logToolCall(action, context, auth, extra, blockchainRid) {
68
- const rid = blockchainRid || exports.DEFAULT_BLOCKCHAIN_RID;
69
- const client = await (0, postchain_client_1.createClient)({
70
- nodeUrlPool: exports.DEFAULT_CHROMIA_NODE_URLS,
71
- blockchainRid: rid,
72
- });
73
- const privKeyBuf = Buffer.from(auth.privkey, "hex");
74
- const keyPair = postchain_client_1.encryption.makeKeyPair(privKeyBuf);
75
- const sigProvider = (0, postchain_client_1.newSignatureProvider)({
76
- privKey: keyPair.privKey,
77
- pubKey: keyPair.pubKey,
78
- });
79
- const toolCallId = generateToolCallId();
80
- await client.signAndSendUniqueTransaction({
81
- name: "log_tool_call",
82
- args: [
83
- toolCallId,
84
- action,
85
- context || "",
86
- extra?.toolName || "",
87
- extra?.toolArgsJson || "",
88
- ],
89
- }, sigProvider);
90
- return toolCallId;
91
- }
92
- async function postJson(url, body, opts) {
93
- const resp = await fetch(url, {
94
- method: "POST",
95
- headers: { "Content-Type": "application/json" },
96
- body: JSON.stringify(body),
97
- signal: opts?.timeout ? AbortSignal.timeout(opts.timeout) : undefined,
98
- });
99
- if (!resp.ok) {
100
- const text = await resp.text().catch(() => "");
101
- throw new Error(`API error ${resp.status}: ${text || resp.statusText}`);
102
- }
103
- const ct = resp.headers.get("content-type") || "";
104
- return ct.includes("application/json")
105
- ? resp.json()
106
- : {};
107
- }
108
- async function getJson(url, opts) {
109
- const resp = await fetch(url, {
110
- method: "GET",
111
- signal: opts?.timeout ? AbortSignal.timeout(opts.timeout) : undefined,
112
- });
113
- if (!resp.ok) {
114
- const text = await resp.text().catch(() => "");
115
- throw new Error(`API error ${resp.status}: ${text || resp.statusText}`);
116
- }
117
- return resp.json();
118
- }
119
- async function judgeAction(action, context, auth, opts) {
120
- // Step 1: Sign and broadcast log_tool_call to the Chromia chain.
121
- // The private key is used locally for signing — never sent over HTTP.
122
- const toolCallId = await logToolCall(action, context, auth, {
123
- toolName: opts?.toolName,
124
- toolArgsJson: opts?.toolArgsJson,
125
- }, opts?.blockchainRid);
126
- // Step 2: Request verdict from the judge API using only the tool_call_id.
127
- const url = `${baseUrl(opts)}/api/v1/judge`;
128
- const data = await postJson(url, {
129
- tool_call_id: toolCallId,
130
- agent_pubkey: auth.pubkey,
131
- action,
132
- context: context || "",
133
- provider: opts?.provider || "",
134
- tool_name: opts?.toolName || "",
135
- api_key: opts?.apiKey || "",
136
- endpoint_url: opts?.providerEndpoint || "",
137
- model: opts?.model || "",
138
- }, opts);
139
- return {
140
- verdict: String(data.verdict || "").toUpperCase(),
141
- action_type: String(data.action_type || ""),
142
- reason: String(data.reason || ""),
143
- confidence: Number(data.confidence ?? 0),
144
- provider: String(data.provider || ""),
145
- latency_ms: Number(data.latency_ms ?? 0),
146
- tool_call_id: String(data.tool_call_id || toolCallId),
147
- on_chain: Boolean(data.on_chain),
148
- };
149
- }
150
- async function getJudgmentStatus(judgmentId, opts) {
151
- const url = `${baseUrl(opts)}/api/v1/judge?tool_call_id=${encodeURIComponent(judgmentId)}`;
152
- const data = await getJson(url, opts);
153
- return {
154
- status: data.status || "error",
155
- verdict: String(data.verdict || ""),
156
- reason: String(data.reason || ""),
157
- judgmentId: String(data.judgmentId || judgmentId),
158
- onChain: Boolean(data.onChain),
159
- cached: Boolean(data.cached),
160
- responseTimeMs: Number(data.responseTimeMs ?? 0),
161
- };
162
- }
163
- function riskEngineUrl(action, params, opts) {
164
- const url = new URL(`${baseUrl(opts)}/api/risk-engine`);
165
- url.searchParams.set("action", action);
166
- for (const [k, v] of Object.entries(params)) {
167
- if (v)
168
- url.searchParams.set(k, v);
169
- }
170
- return url.toString();
171
- }
172
- async function getToolCalls(maxCount, opts) {
173
- return getJson(riskEngineUrl("tool-calls", { limit: String(maxCount) }, opts), opts);
174
- }
175
- async function getOrgToolCalls(orgName, maxCount, opts) {
176
- return getJson(riskEngineUrl("org-tool-calls", { org: orgName, limit: String(maxCount) }, opts), opts);
177
- }
178
- async function getAgentToolCalls(agentPubkey, maxCount, opts) {
179
- return getJson(riskEngineUrl("agent-tool-calls", { agent: agentPubkey, limit: String(maxCount) }, opts), opts);
180
- }
181
- async function getToolCallCount(opts) {
182
- const result = await getJson(riskEngineUrl("tool-call-count", {}, opts), opts);
183
- return typeof result === "number" ? result : Number(result ?? 0);
184
- }
185
- async function getToolCallFull(toolCallId, opts) {
186
- return getJson(riskEngineUrl("tool-call-full", { tool_call_id: toolCallId }, opts), opts);
187
- }
188
- async function getOrgTierInfo(orgName, opts) {
189
- return getJson(riskEngineUrl("org-tier-info", { org: orgName }, opts), opts);
190
- }
191
- async function getPendingHeldActions(orgName, maxCount, opts) {
192
- return getJson(riskEngineUrl("pending-held-actions", { org: orgName, limit: String(maxCount) }, opts), opts);
193
- }
194
- async function getHeldActionReviews(orgName, maxCount, opts) {
195
- return getJson(riskEngineUrl("held-action-reviews", { org: orgName, limit: String(maxCount) }, opts), opts);
196
- }
197
- function riskEnginePostUrl(opts) {
198
- return `${baseUrl(opts)}/api/risk-engine`;
199
- }
200
- async function getAgentDetail(agentPubkey, opts) {
201
- return postJson(riskEnginePostUrl(opts), {
202
- action: "agent-detail-batch",
203
- agent: agentPubkey,
204
- }, opts);
205
- }
206
- async function getAgentPolicy(agentPubkey, opts) {
207
- return postJson(riskEnginePostUrl(opts), {
208
- action: "agent-policy-batch",
209
- agent: agentPubkey,
210
- }, opts);
211
- }
212
- async function getSafetyStats(opts) {
213
- const url = `${baseUrl(opts)}/api/insurance?action=safety-stats`;
214
- const result = await getJson(url, opts);
215
- return (result?.data || result);
216
- }
217
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAcA,8CAEC;AAED,0CAIC;AAED,0CAOC;AAMD,kCAQC;AAiBD,kCAqCC;AAyHD,kCAyCC;AAED,8CAgBC;AAeD,oCAQC;AAED,0CAaC;AAED,8CAaC;AAED,4CAMC;AAED,0CAQC;AAED,wCAQC;AAED,sDAaC;AAED,oD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,IAAI,CAAC,EACvB;QACE,MAAM,EAAE,oBAAoB;QAC5B,KAAK,EAAE,WAAW;KACnB,EACD,IAAI,CACL,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,cAAc,CAClC,WAAmB,EACnB,IAAiB;IAOjB,OAAO,QAAQ,CACb,iBAAiB,CAAC,IAAI,CAAC,EACvB;QACE,MAAM,EAAE,oBAAoB;QAC5B,KAAK,EAAE,WAAW;KACnB,EACD,IAAI,CACL,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,cAAc,CAClC,IAAiB;IAEjB,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,oCAAoC,CAAC;IACjE,MAAM,MAAM,GAAG,MAAM,OAAO,CAAqC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC5E,OAAO,CAAC,MAAM,EAAE,IAAI,IAAI,MAAM,CAA4B,CAAC;AAC7D,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Command } from "commander";
2
- /**
3
- * Auto-install completion into ~/.zshrc on first run.
4
- * Safe to call multiple times — skips if already installed.
5
- */
6
- export declare function installCompletionIfNeeded(): void;
7
- export declare function registerCompletionCommand(program: Command): void;
@@ -1,207 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.installCompletionIfNeeded = installCompletionIfNeeded;
40
- exports.registerCompletionCommand = registerCompletionCommand;
41
- const fs = __importStar(require("fs"));
42
- const path = __importStar(require("path"));
43
- const os = __importStar(require("os"));
44
- const chalk_1 = __importDefault(require("chalk"));
45
- const ZSH_COMPLETION = `#compdef atbash
46
-
47
- _atbash() {
48
- local -a commands
49
- commands=(
50
- 'judge:Submit a pending action for judgment'
51
- 'whoami:Show your agent on-chain info'
52
- 'policy:View your agent safety policy'
53
- 'tier:Show tier info for your org'
54
- 'tools:Query tool call logs'
55
- 'held:View held actions'
56
- 'history:Show recent tool call activity'
57
- 'stats:Show chain-wide verdict statistics'
58
- 'status:Check the status of a judgment by ID'
59
- 'keygen:Generate a new agent keypair'
60
- 'set:Save a configuration value'
61
- 'unset:Remove a single configuration value'
62
- 'wipe:Clear all saved configuration'
63
- 'config:Show current configuration'
64
- 'completion:Output shell completion script'
65
- )
66
-
67
- local -a judge_opts
68
- judge_opts=(
69
- '(-c --context)'{-c,--context}'[Operational context]:context:'
70
- '(-k --agent-key)'{-k,--agent-key}'[Agent private key]:key:'
71
- '--provider[Inference provider]:provider:(openai google microsoft custom)'
72
- '--model[Model override]:model:'
73
- '--org[Org name]:org:'
74
- '--endpoint[Judge API base URL]:url:'
75
- '--timeout[Max wait for verdict (ms)]:ms:'
76
- '--json[Output result as JSON]'
77
- )
78
-
79
- local -a set_args
80
- set_args=(
81
- 'agent-key'
82
- 'org-name'
83
- 'endpoint'
84
- 'rid'
85
- 'provider'
86
- 'model'
87
- )
88
-
89
- local -a unset_args
90
- unset_args=(
91
- 'agent-key'
92
- 'org-name'
93
- 'endpoint'
94
- 'rid'
95
- 'provider'
96
- 'model'
97
- )
98
-
99
- _arguments -C \\
100
- '(-v --version)'{-v,--version}'[Show version]' \\
101
- '(-h --help)'{-h,--help}'[Show help]' \\
102
- '1:command:->cmd' \\
103
- '*::arg:->args'
104
-
105
- case $state in
106
- cmd)
107
- _describe 'command' commands
108
- ;;
109
- args)
110
- case $words[1] in
111
- judge)
112
- _arguments $judge_opts '1:action:'
113
- ;;
114
- set)
115
- _arguments '1:key:(agent-key org-name endpoint rid provider model)' '2:value:'
116
- ;;
117
- unset)
118
- _arguments '1:key:(agent-key org-name endpoint rid provider model)'
119
- ;;
120
- tier|held|tools|history)
121
- _arguments '--org[Org name]:org:'
122
- ;;
123
- status)
124
- _arguments '1:judgment-id:' '(-k --agent-key)'{-k,--agent-key}'[Agent key]:key:'
125
- ;;
126
- esac
127
- ;;
128
- esac
129
- }
130
-
131
- _atbash
132
- `;
133
- const BASH_COMPLETION = `_atbash() {
134
- local cur prev commands
135
- COMPREPLY=()
136
- cur="\${COMP_WORDS[COMP_CWORD]}"
137
- prev="\${COMP_WORDS[COMP_CWORD-1]}"
138
- commands="judge whoami policy tier tools held history stats status keygen set unset wipe config completion"
139
-
140
- case "\${prev}" in
141
- atbash)
142
- COMPREPLY=( $(compgen -W "\${commands}" -- "\${cur}") )
143
- return 0
144
- ;;
145
- set|unset)
146
- COMPREPLY=( $(compgen -W "agent-key org-name endpoint rid provider model" -- "\${cur}") )
147
- return 0
148
- ;;
149
- --provider)
150
- COMPREPLY=( $(compgen -W "openai google microsoft custom" -- "\${cur}") )
151
- return 0
152
- ;;
153
- esac
154
- }
155
-
156
- complete -F _atbash atbash
157
- `;
158
- const COMPLETION_DIR = path.join(os.homedir(), ".config", "atbash");
159
- const COMPLETION_FILE = path.join(COMPLETION_DIR, "completion.zsh");
160
- const MARKER = '# atbash shell completion';
161
- /**
162
- * Auto-install completion into ~/.zshrc on first run.
163
- * Safe to call multiple times — skips if already installed.
164
- */
165
- function installCompletionIfNeeded() {
166
- try {
167
- const shell = process.env.SHELL || "";
168
- if (!shell.includes("zsh"))
169
- return; // only zsh for now
170
- const zshrc = path.join(os.homedir(), ".zshrc");
171
- // Check if already installed
172
- if (fs.existsSync(zshrc)) {
173
- const content = fs.readFileSync(zshrc, "utf-8");
174
- if (content.includes(MARKER))
175
- return; // already there
176
- }
177
- // Write completion script to ~/.config/atbash/completion.zsh
178
- fs.mkdirSync(COMPLETION_DIR, { recursive: true });
179
- fs.writeFileSync(COMPLETION_FILE, ZSH_COMPLETION);
180
- // Append source line to .zshrc
181
- const line = `\n${MARKER}\nsource "${COMPLETION_FILE}"\n`;
182
- fs.appendFileSync(zshrc, line);
183
- console.log(chalk_1.default.dim(" Tab completion installed. Restart your terminal or run: source ~/.zshrc"));
184
- }
185
- catch {
186
- // Never crash on completion install failure
187
- }
188
- }
189
- function registerCompletionCommand(program) {
190
- program
191
- .command("completion")
192
- .description("Output shell completion script")
193
- .option("--shell <shell>", "Shell type: zsh or bash", "zsh")
194
- .action((opts) => {
195
- const shell = opts.shell.toLowerCase();
196
- if (shell === "bash") {
197
- console.log(BASH_COMPLETION);
198
- }
199
- else {
200
- console.log(ZSH_COMPLETION);
201
- }
202
- console.error(shell === "zsh"
203
- ? '# Add to ~/.zshrc:\n# eval "$(atbash completion)"'
204
- : '# Add to ~/.bashrc:\n# eval "$(atbash completion --shell bash)"');
205
- });
206
- }
207
- //# sourceMappingURL=completion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiI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AElD,+BAA+B;QAC/B,MAAM,IAAI,GAAG,KAAK,MAAM,aAAa,eAAe,KAAK,CAAC;QAC1D,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAE/B,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,GAAG,CAAC,2EAA2E,CAAC,CACvF,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,4CAA4C;IAC9C,CAAC;AACH,CAAC;AAED,SAAgB,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,gCAAgC,CAAC;SAC7C,MAAM,CAAC,iBAAiB,EAAE,yBAAyB,EAAE,KAAK,CAAC;SAC3D,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,CAAC,KAAK,CACX,KAAK,KAAK,KAAK;YACb,CAAC,CAAC,qDAAqD;YACvD,CAAC,CAAC,mEAAmE,CACxE,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * `atbash unjail` — Unjail an agent via POST /api/risk-engine action=unjail-agent.
3
- * Jail command removed — jailing happens automatically on RED verdict in Enforcement tier.
4
- */
5
- import { Command } from "commander";
6
- export declare function registerUnjailCommand(program: Command): void;
@@ -1,44 +0,0 @@
1
- "use strict";
2
- /**
3
- * `atbash unjail` — Unjail an agent via POST /api/risk-engine action=unjail-agent.
4
- * Jail command removed — jailing happens automatically on RED verdict in Enforcement tier.
5
- */
6
- var __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
8
- };
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.registerUnjailCommand = registerUnjailCommand;
11
- const chalk_1 = __importDefault(require("chalk"));
12
- const ora_1 = __importDefault(require("ora"));
13
- const client_1 = require("../client");
14
- const config_1 = require("../config");
15
- function registerUnjailCommand(program) {
16
- program
17
- .command("unjail")
18
- .description("Unjail an agent")
19
- .argument("<agent-pubkey>", "Agent public key to unjail (hex)")
20
- .option("--endpoint <url>", "API endpoint URL")
21
- .option("--json", "Output result as JSON")
22
- .action(async (agentPubkey, opts) => {
23
- const spinner = opts.json ? null : (0, ora_1.default)("Unjailing agent...").start();
24
- try {
25
- await (0, client_1.unjailAgent)(agentPubkey, {
26
- endpoint: (0, config_1.resolveEndpoint)(opts.endpoint),
27
- });
28
- spinner?.succeed("Agent unjailed");
29
- if (opts.json) {
30
- console.log(JSON.stringify({ agentPubkey, action: "unjailed" }, null, 2));
31
- return;
32
- }
33
- console.log();
34
- console.log(` Agent: ${chalk_1.default.dim(agentPubkey.slice(0, 8) + "..." + agentPubkey.slice(-6))}`);
35
- console.log(` Status: ${chalk_1.default.green.bold("ACTIVE")}`);
36
- }
37
- catch (err) {
38
- spinner?.fail("Failed to unjail agent");
39
- console.error(chalk_1.default.red(`\nError: ${err instanceof Error ? err.message : String(err)}`));
40
- process.exit(1);
41
- }
42
- });
43
- }
44
- //# sourceMappingURL=jail.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jail.js","sourceRoot":"","sources":["../../src/commands/jail.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAQH,sDA+BC;AApCD,kDAA0B;AAC1B,8CAAsB;AACtB,sCAAwC;AACxC,sCAA4C;AAE5C,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,iBAAiB,CAAC;SAC9B,QAAQ,CAAC,gBAAgB,EAAE,kCAAkC,CAAC;SAC9D,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AC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;YACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerOrgCommand(program: Command): void;
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.registerOrgCommand = registerOrgCommand;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const ora_1 = __importDefault(require("ora"));
9
- const client_1 = require("../client");
10
- const config_1 = require("../config");
11
- function registerOrgCommand(program) {
12
- const org = program
13
- .command("org")
14
- .description("Manage org membership");
15
- org
16
- .command("join")
17
- .description("Add your agent to an org")
18
- .option("--org <name>", "Org name to join")
19
- .option("-k, --agent-key <key>", "Agent private key (to derive pubkey)")
20
- .option("--agent-pubkey <pubkey>", "Agent public key directly (66 hex chars)")
21
- .option("--endpoint <url>", "API endpoint URL")
22
- .option("--json", "Output result as JSON")
23
- .action(async (opts) => {
24
- const orgName = opts.org || (0, config_1.resolveOrgName)();
25
- if (!orgName) {
26
- console.error(chalk_1.default.red("Error: Org name required.\n") +
27
- "Provide via --org, ATBASH_ORG_NAME env var, or run " +
28
- chalk_1.default.cyan("atbash set org-name <name>"));
29
- process.exit(1);
30
- }
31
- let pubkey = opts.agentPubkey || "";
32
- if (!pubkey) {
33
- const agentKey = (0, config_1.resolveAgentKey)(opts.agentKey);
34
- if (!agentKey) {
35
- console.error(chalk_1.default.red("Error: Agent key or --agent-pubkey required.\n") +
36
- "Provide via --agent-key, --agent-pubkey, or run " +
37
- chalk_1.default.cyan("atbash set agent-key <key>"));
38
- process.exit(1);
39
- return;
40
- }
41
- const cleanKey = agentKey.replace(/^0x/, "").trim().toLowerCase();
42
- if (!(0, client_1.isValidPrivateKey)(cleanKey)) {
43
- console.error(chalk_1.default.red("Error: Invalid private key."));
44
- process.exit(1);
45
- }
46
- pubkey = (0, client_1.derivePublicKey)(cleanKey);
47
- }
48
- const spinner = opts.json
49
- ? null
50
- : (0, ora_1.default)(`Adding agent to ${orgName}...`).start();
51
- try {
52
- await (0, client_1.addAgentToOrg)(pubkey, orgName, {
53
- endpoint: (0, config_1.resolveEndpoint)(opts.endpoint),
54
- });
55
- spinner?.succeed(`Agent added to ${orgName}`);
56
- if (opts.json) {
57
- console.log(JSON.stringify({ agentPubkey: pubkey, orgName, status: "added" }, null, 2));
58
- return;
59
- }
60
- console.log();
61
- console.log(` Agent: ${chalk_1.default.cyan(pubkey)}`);
62
- console.log(` Org: ${chalk_1.default.white(orgName)}`);
63
- }
64
- catch (err) {
65
- spinner?.fail("Failed to add agent to org");
66
- const msg = err instanceof Error ? err.message : String(err);
67
- console.error(chalk_1.default.red(`\nError: ${err}`));
68
- process.exit(1);
69
- }
70
- });
71
- }
72
- //# sourceMappingURL=org.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"org.js","sourceRoot":"","sources":["../../src/commands/org.ts"],"names":[],"mappings":";;;;;AAMA,gDAyEC;AA9ED,kDAA0B;AAC1B,8CAAsB;AACtB,sCAA8E;AAC9E,sCAA6E;AAE7E,SAAgB,kBAAkB,CAAC,OAAgB;IACjD,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAExC,GAAG;SACA,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC;SAC1C,MAAM,CAAC,uBAAuB,EAAE,sCAAsC,CAAC;SACvE,MAAM,CAAC,yBAAyB,EAAE,0CAA0C,CAAC;SAC7E,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;SAC9C,MAAM,CA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
- declare const CONFIG_FILE: string;
2
- export interface AtbashConfig {
3
- agentKey?: string;
4
- adminKey?: string;
5
- orgName?: string;
6
- judgeEndpoint?: string;
7
- blockchainRid?: string;
8
- provider?: string;
9
- providerApiKey?: string;
10
- providerEndpoint?: string;
11
- providerModel?: string;
12
- debug?: boolean;
13
- }
14
- export declare function loadConfig(): AtbashConfig;
15
- export declare function saveConfig(config: AtbashConfig): void;
16
- /** Resolve a config value with priority: flag > env > file */
17
- export declare function resolveAgentKey(flagValue?: string): string | undefined;
18
- export declare function resolveOrgName(flagValue?: string): string | undefined;
19
- export declare function resolveEndpoint(flagValue?: string): string | undefined;
20
- export declare function resolveProvider(flagValue?: string): string;
21
- export declare function resolveProviderApiKey(flagValue?: string): string;
22
- export declare function resolveProviderEndpoint(flagValue?: string): string;
23
- export declare function resolveProviderModel(flagValue?: string): string;
24
- export declare function resolveBlockchainRid(flagValue?: string): string;
25
- export { CONFIG_FILE };
package/dist/config.js DELETED
@@ -1,94 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.CONFIG_FILE = void 0;
37
- exports.loadConfig = loadConfig;
38
- exports.saveConfig = saveConfig;
39
- exports.resolveAgentKey = resolveAgentKey;
40
- exports.resolveOrgName = resolveOrgName;
41
- exports.resolveEndpoint = resolveEndpoint;
42
- exports.resolveProvider = resolveProvider;
43
- exports.resolveProviderApiKey = resolveProviderApiKey;
44
- exports.resolveProviderEndpoint = resolveProviderEndpoint;
45
- exports.resolveProviderModel = resolveProviderModel;
46
- exports.resolveBlockchainRid = resolveBlockchainRid;
47
- const fs = __importStar(require("fs"));
48
- const path = __importStar(require("path"));
49
- const os = __importStar(require("os"));
50
- const CONFIG_FILE = path.join(os.homedir(), ".atbashrc.json");
51
- exports.CONFIG_FILE = CONFIG_FILE;
52
- function loadConfig() {
53
- try {
54
- if (fs.existsSync(CONFIG_FILE)) {
55
- const raw = fs.readFileSync(CONFIG_FILE, "utf-8");
56
- if (!raw.trim())
57
- return {};
58
- return JSON.parse(raw);
59
- }
60
- }
61
- catch (err) {
62
- console.error("Failed to load config file", err);
63
- }
64
- return {};
65
- }
66
- function saveConfig(config) {
67
- fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n", "utf-8");
68
- }
69
- /** Resolve a config value with priority: flag > env > file */
70
- function resolveAgentKey(flagValue) {
71
- return flagValue || process.env.ATBASH_AGENT_KEY || loadConfig().agentKey;
72
- }
73
- function resolveOrgName(flagValue) {
74
- return flagValue || process.env.ATBASH_ORG_NAME || loadConfig().orgName;
75
- }
76
- function resolveEndpoint(flagValue) {
77
- return flagValue || process.env.ATBASH_ENDPOINT || loadConfig().judgeEndpoint;
78
- }
79
- function resolveProvider(flagValue) {
80
- return flagValue || process.env.ATBASH_PROVIDER || loadConfig().provider || "";
81
- }
82
- function resolveProviderApiKey(flagValue) {
83
- return flagValue || process.env.ATBASH_PROVIDER_API_KEY || loadConfig().providerApiKey || "";
84
- }
85
- function resolveProviderEndpoint(flagValue) {
86
- return flagValue || process.env.ATBASH_PROVIDER_ENDPOINT || loadConfig().providerEndpoint || "";
87
- }
88
- function resolveProviderModel(flagValue) {
89
- return flagValue || process.env.ATBASH_PROVIDER_MODEL || loadConfig().providerModel || "";
90
- }
91
- function resolveBlockchainRid(flagValue) {
92
- return flagValue || process.env.ATBASH_BLOCKCHAIN_RID || loadConfig().blockchainRid || "";
93
- }
94
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,gCAWC;AAED,gCAEC;AAGD,0CAEC;AAED,wCAEC;AAED,0CAEC;AAED,0CAEC;AAED,sDAEC;AAED,0DAEC;AAED,oDAEC;AAED,oDAEC;AAnED,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,gBAAgB,CAAC,CAAC;AAiErD,kCAAW;AAlDpB,SAAgB,UAAU;IACxB,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/B,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAClD,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;gBAAE,OAAO,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAiB,CAAC;QACzC,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK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B,IAAI,UAAU,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC;AAC5F,CAAC;AAED,SAAgB,oBAAoB,CAAC,SAAkB;IACrD,OAAO,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,UAAU,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC;AAC5F,CAAC"}
package/dist/presets.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * Reference policy shapes for the Atbash CLI.
3
- *
4
- * These are reference packs — the starting points an operator might author
5
- * against. They match the format produced by the dashboard's
6
- * buildCompactPolicyText(). Production policies are authored, versioned, and
7
- * signed in the dashboard, not loaded from here.
8
- */
9
- export declare const PRESETS: Record<string, {
10
- name: string;
11
- description: string;
12
- policy: string;
13
- }>;
14
- export declare function listPresets(): string[];
package/dist/presets.js DELETED
@@ -1,73 +0,0 @@
1
- "use strict";
2
- /**
3
- * Reference policy shapes for the Atbash CLI.
4
- *
5
- * These are reference packs — the starting points an operator might author
6
- * against. They match the format produced by the dashboard's
7
- * buildCompactPolicyText(). Production policies are authored, versioned, and
8
- * signed in the dashboard, not loaded from here.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.PRESETS = void 0;
12
- exports.listPresets = listPresets;
13
- exports.PRESETS = {
14
- strict: {
15
- name: "Strict",
16
- description: "Reference shape for privileged-ops agents — blocks IAM elevation, credential export, and bulk exfil; holds every cross-border or over-threshold transfer",
17
- policy: `Agent Policy
18
- Risk: high
19
-
20
- Enabled rules:
21
- - [Financial] CRITICAL -> BLOCK when Transfers exceeding threshold to unwhitelisted addresses (threshold: $1,000) <!--f1-->
22
- - [Financial] HIGH -> HOLD when Cross-border transactions (threshold: All) <!--f2-->
23
- - [Financial] CRITICAL -> BLOCK when Cryptocurrency wallet transfers without 2FA confirmation (threshold: Any amount) <!--f3-->
24
- - [Financial] HIGH -> HOLD when Invoice generation or payment request above threshold (threshold: $5,000) <!--f5-->
25
- - [Financial] CRITICAL -> BLOCK when Access to payment gateway API keys or merchant credentials (threshold: Any) <!--f6-->
26
- - [Communication] HIGH -> BLOCK when Mass emails exceeding recipient threshold without approval (threshold: 50 recipients) <!--c2-->
27
- - [Communication] CRITICAL -> BLOCK when Outbound messages to domains on blocklist (threshold: Custom list) <!--c5-->
28
- - [Communication] CRITICAL -> BLOCK when Sending messages impersonating another user or agent (threshold: Any) <!--c7-->
29
- - [File system] CRITICAL -> BLOCK when Read/write to restricted directories (threshold: /etc, /var, ~/.ssh) <!--fs1-->
30
- - [File system] CRITICAL -> BLOCK when Access to credential or secret files (threshold: .env, config, secrets.*) <!--fs3-->
31
- - [Code execution] CRITICAL -> BLOCK when Elevated privilege commands (threshold: sudo, chmod, rm -rf) <!--ce1-->
32
- - [Code execution] CRITICAL -> BLOCK when Spawning reverse shells or outbound listeners (threshold: Any) <!--ce3-->
33
- - [Network] CRITICAL -> BLOCK when Connections to malicious or blacklisted domains (threshold: Threat intel feed) <!--nw1-->
34
- - [Network] CRITICAL -> BLOCK when Data exfiltration exceeding size (threshold: 10 MB) <!--nw4-->
35
- - [Accounts] CRITICAL -> BLOCK when Privilege escalation or admin scope requests (threshold: Any) <!--ai1-->
36
- - [Accounts] CRITICAL -> BLOCK when Password or credential reset attempts (threshold: Any) <!--ai4-->`,
37
- },
38
- moderate: {
39
- name: "Moderate",
40
- description: "Reference shape for business-ops agents — blocks clear red lines, holds mid-blast-radius actions for human review",
41
- policy: `Agent Policy
42
- Risk: medium
43
-
44
- Enabled rules:
45
- - [Financial] CRITICAL -> BLOCK when Transfers exceeding threshold to unwhitelisted addresses (threshold: $5,000) <!--f1-->
46
- - [Financial] HIGH -> HOLD when Cross-border transactions (threshold: All) <!--f2-->
47
- - [Financial] CRITICAL -> BLOCK when Cryptocurrency wallet transfers without 2FA (threshold: Any amount) <!--f3-->
48
- - [Financial] LOW -> PASS when Recurring payments to pre-approved vendors under threshold (threshold: $500) <!--f4-->
49
- - [Communication] MEDIUM -> HOLD when Emails to external domains with large attachments (threshold: 5 MB) <!--c1-->
50
- - [Communication] HIGH -> BLOCK when Mass emails exceeding recipient threshold (threshold: 50 recipients) <!--c2-->
51
- - [Communication] CRITICAL -> BLOCK when Outbound messages to domains on blocklist (threshold: Custom list) <!--c5-->
52
- - [Code execution] CRITICAL -> BLOCK when Elevated privilege commands (threshold: sudo, chmod, rm -rf) <!--ce1-->
53
- - [Code execution] CRITICAL -> BLOCK when Spawning reverse shells or outbound listeners (threshold: Any) <!--ce3-->
54
- - [Network] CRITICAL -> BLOCK when Connections to malicious or blacklisted domains (threshold: Threat intel feed) <!--nw1-->`,
55
- },
56
- minimal: {
57
- name: "Minimal",
58
- description: "Reference shape for audit-tier rollout — only the categorical red lines, intended for observation before enforcement is turned on",
59
- policy: `Agent Policy
60
- Risk: low
61
-
62
- Enabled rules:
63
- - [Financial] CRITICAL -> BLOCK when Transfers exceeding threshold to unwhitelisted addresses (threshold: $10,000) <!--f1-->
64
- - [Financial] CRITICAL -> BLOCK when Cryptocurrency wallet transfers without 2FA (threshold: Any amount) <!--f3-->
65
- - [Code execution] CRITICAL -> BLOCK when Spawning reverse shells or outbound listeners (threshold: Any) <!--ce3-->
66
- - [Network] CRITICAL -> BLOCK when Connections to malicious or blacklisted domains (threshold: Threat intel feed) <!--nw1-->
67
- - [Network] CRITICAL -> BLOCK when Data exfiltration exceeding size (threshold: 10 MB) <!--nw4-->`,
68
- },
69
- };
70
- function listPresets() {
71
- return Object.keys(exports.PRESETS);
72
- }
73
- //# sourceMappingURL=presets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"presets.js","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AA8DH,kCAEC;AA9DY,QAAA,OAAO,GAA0E;IAC5F,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,0JAA0J;QACvK,MAAM,EAAE;;;;;;;;;;;;;;;;;;;sGAmB0F;KACnG;IAED,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,mHAAmH;QAChI,MAAM,EAAE;;;;;;;;;;;;;6HAaiH;KAC1H;IAED,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,mIAAmI;QAChJ,MAAM,EAAE;;;;;;;;kGAQsF;KAC/F;CACF,CAAC;AAEF,SAAgB,WAAW;IACzB,OAAO,MAAM,CAAC,IAAI,CAAC,eAAO,CAAC,CAAC;AAC9B,CAAC"}