agentx-security-sdk 0.3.0__tar.gz → 0.3.2__tar.gz

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.
Files changed (27) hide show
  1. agentx_security_sdk-0.3.2/PKG-INFO +333 -0
  2. agentx_security_sdk-0.3.2/README.md +308 -0
  3. agentx_security_sdk-0.3.2/agentx_sdk/__init__.py +4 -0
  4. agentx_security_sdk-0.3.2/agentx_sdk/cli.py +263 -0
  5. agentx_security_sdk-0.3.2/agentx_sdk/client.py +136 -0
  6. agentx_security_sdk-0.3.2/agentx_sdk/db.py +161 -0
  7. agentx_security_sdk-0.3.2/agentx_sdk/decorators.py +992 -0
  8. agentx_security_sdk-0.3.2/agentx_sdk/test_agentx_sdk.py +415 -0
  9. agentx_security_sdk-0.3.2/agentx_sdk/test_cli.py +196 -0
  10. agentx_security_sdk-0.3.2/agentx_sdk/test_client.py +264 -0
  11. agentx_security_sdk-0.3.2/agentx_sdk/test_db.py +293 -0
  12. agentx_security_sdk-0.3.2/agentx_sdk/test_fail_modes.py +196 -0
  13. agentx_security_sdk-0.3.2/agentx_security_sdk.egg-info/PKG-INFO +333 -0
  14. {agentx_security_sdk-0.3.0 → agentx_security_sdk-0.3.2}/agentx_security_sdk.egg-info/SOURCES.txt +8 -1
  15. agentx_security_sdk-0.3.2/agentx_security_sdk.egg-info/entry_points.txt +2 -0
  16. {agentx_security_sdk-0.3.0 → agentx_security_sdk-0.3.2}/setup.py +9 -3
  17. agentx_security_sdk-0.3.0/PKG-INFO +0 -159
  18. agentx_security_sdk-0.3.0/README.txt +0 -29
  19. agentx_security_sdk-0.3.0/agentx_sdk/__init__.py +0 -4
  20. agentx_security_sdk-0.3.0/agentx_sdk/client.py +0 -42
  21. agentx_security_sdk-0.3.0/agentx_sdk/db.py +0 -112
  22. agentx_security_sdk-0.3.0/agentx_sdk/decorators.py +0 -216
  23. agentx_security_sdk-0.3.0/agentx_security_sdk.egg-info/PKG-INFO +0 -159
  24. {agentx_security_sdk-0.3.0 → agentx_security_sdk-0.3.2}/agentx_security_sdk.egg-info/dependency_links.txt +0 -0
  25. {agentx_security_sdk-0.3.0 → agentx_security_sdk-0.3.2}/agentx_security_sdk.egg-info/requires.txt +0 -0
  26. {agentx_security_sdk-0.3.0 → agentx_security_sdk-0.3.2}/agentx_security_sdk.egg-info/top_level.txt +0 -0
  27. {agentx_security_sdk-0.3.0 → agentx_security_sdk-0.3.2}/setup.cfg +0 -0
@@ -0,0 +1,333 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentx-security-sdk
3
+ Version: 0.3.2
4
+ Summary: The self-healing exception handler for autonomous AI agents.
5
+ Home-page: https://github.com/vdalal/semantic-gateway
6
+ Author: AgentX Core Team
7
+ Author-email: founders@agentx-core.com
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: requests>=2.25.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+ Dynamic: summary
25
+
26
+ # 🛡️ AgentX: The Action Firewall for AI Agents
27
+
28
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
29
+ ![License: Proprietary](https://img.shields.io/badge/License-Proprietary-red.svg)
30
+
31
+ LLM Agents are brilliant, but they are incredibly brittle. They will drop your production database, leak AWS keys, and fall victim to prompt injections. Traditional firewalls just crash the agent by returning a hard `403 Forbidden` exception, killing the run completely and wasting compute tokens.
32
+
33
+ **AgentX is different — and it starts protecting you with zero keys.** Its hero is a **deterministic security floor** (the *Shield*): a local, sub-millisecond, zero-LLM layer that **hard-blocks** the catastrophic call (`DROP TABLE`, SSRF, secret reads, supply-chain RCE, destructive shell/cloud teardown) and **escalates to a human** the consequential-but-legitimate ones (large transfers, external publishes, runaway spend, bulk deletes). No API key, no signup, no network round-trip.
34
+
35
+ Add a Gemini key and the optional **reasoning layer** turns each block into a **recoverable challenge** instead of a fatal `403` — the agent rethinks its strategy, fixes its parameters, and finishes the task *without crashing your application or draining tokens on a wiped run* — plus Discovery for novel-intent classification.
36
+
37
+ ### 🛡️ Block the catastrophic deterministically. 🧠 Coach the recoverable when you add a key.
38
+
39
+ ---
40
+
41
+ ## 🏗️ Split-Plane Architecture
42
+
43
+ AgentX relies on a decoupled, split-plane hybrid architecture to balance latency with deep cognitive reasoning:
44
+
45
+ * **The Edge SDK (`agentx_sdk`):** A low-config Python package instrumenting sensitive tool calls via reflective code signatures.
46
+ * **The Data Plane (Neuro-Symbolic Reasoning Engine):** A high-performance Python FastAPI service (the "Wedge"). Handles Abstract Syntax Tree (AST) evaluation, zero-day threat trapping, and the local immunity signature lookup via a strict Layer 0 -> Layer 1 -> Layer 2 funnel (the cross-node **Shared Immunity Network** is a roadmap capability — see Pillar 3).
47
+ * **The Control Plane (Dashboard):** A Next.js application listening on port `3000`. Provides an executive command console for tracking corporate ROI metrics, analyzing agent Chain of Thought (CoT) loops, and promoting newly discovered policy vectors. Reads through a mode-aware edge layer: the gateway's local SQLite store in `local`/`linked` mode, a Supabase-backed real-time ledger in `cloud` mode.
48
+
49
+ ---
50
+
51
+ ## ⚡ 1. Quickstart
52
+
53
+ AgentX requires **zero changes** to your underlying agentic logic, custom tools, or payload schemas. The SDK dynamically inspects function signatures at runtime using an auto-reflective ingestion engine.
54
+
55
+ ### Step 1: Install the SDK
56
+ ```bash
57
+ pip install agentx-security-sdk
58
+ ```
59
+
60
+ ### Step 2: Decorate Sensitive Tool Operations
61
+ Attach the `@agentx_protect` decorator over any high-risk system tool. The SDK automatically serializes parameters and enforces the evaluation wedge:
62
+
63
+ ```python
64
+ # ✅ MODERN REFLECTIVE IMPORTS (No boilerplate functions required)
65
+ from agentx_sdk.decorators import agentx_protect
66
+
67
+ @agentx_protect(agent_id="frictionless_enterprise_worker")
68
+ def dispatch_crm_update(client_id: str, profile_notes: str, db_session=None):
69
+ """
70
+ AgentX automatically inspects string elements, ignores connection objects
71
+ like 'db_session', and evaluates intents out-of-prompt natively in RAM.
72
+ """
73
+ print(f"Updating records for {client_id}")
74
+ ```
75
+ ---
76
+
77
+ ### Step 3: Configure Environment Flags
78
+
79
+ Copy `.env.example` to `.env`. **You can run with zero keys.** Two *independent* axes shape your posture — the activation ladder:
80
+
81
+ - **Reasoning axis (how much intelligence):** **Shield** is the default and needs no keys — the deterministic floor only. Add a `GEMINI_API_KEY` to unlock the reasoning judge (recovery coaching + Discovery). Force Shield even when a key is present with `AGENTX_REASONING=off`.
82
+ - **Data axis — `AGENTX_MODE` (where data lives + sync):** `local` (isolated, no sync) → `linked` (explicit pull/push) → `cloud` (continuous sync + HITL/SOC; needs `AGENTX_API_KEY`).
83
+
84
+ Shield is **not** a fourth mode — it crosses all three (you can run `cloud` + Shield, or `local` + judge).
85
+
86
+ ```text
87
+ # Data axis — where data lives + sync posture:
88
+ # local isolated; local SQLite store; no sync; no keys required
89
+ # linked local-authoritative; explicit pull/push; no auto-sync
90
+ # cloud control plane authoritative; continuous sync + upload + HITL/SOC
91
+ AGENTX_MODE=local
92
+ NEXT_PUBLIC_AGENTX_MODE=local # the UI's build-time copy; keep it equal
93
+
94
+ # Reasoning axis — OPTIONAL. Unset = Shield (floor-only, zero LLM, zero keys).
95
+ # Add a key to unlock the judge (recovery coaching + Discovery).
96
+ # GEMINI_API_KEY=your_gemini_key_here # from aistudio.google.com
97
+ # AGENTX_REASONING=off # force Shield even when a key is present
98
+
99
+ # AgentX API key — required for `cloud` (and `linked` against a remote plane).
100
+ # Omit for `local`/Shield; the gateway falls back to a sandbox key.
101
+ # AGENTX_API_KEY=agentx_sk_your_key_here
102
+ ```
103
+
104
+ **Safety posture (optional).** By default AgentX **fails open** — if the Reasoning Engine is unreachable, tool calls still execute, but with a loud warning, an audit tally in the session summary, and the in-process offline keyword shield still blocking deterministic threats (e.g. `DROP TABLE`). For high-stakes or irreversible actions, set `AGENTX_FAIL_MODE=closed` to instead **block** any tool call the engine can't verify until it recovers.
105
+
106
+ ---
107
+
108
+ ### Step 4: Spin up the Edge Reasoning Engine
109
+ Boot your local data plane wedge proxy middleware and your frontend dashboard console node simultaneously:
110
+
111
+ ```bash
112
+ docker-compose up -d
113
+ ```
114
+ OR
115
+
116
+ ```bash
117
+ cd backend
118
+ uvicorn gateway:app --host "0.0.0.0" --port=8000
119
+ ```
120
+
121
+ The reasoning engine is now listening on http://localhost:8000. In `local`/`linked` mode it owns the policy lifecycle from a local SQLite store (seeded on first boot, editable via the Policy & Discovery tabs); in `cloud` mode it mirrors policies from your Supabase-backed Control Plane.
122
+
123
+ ---
124
+
125
+ ### Step 5: Run a Live Frictionless Run Pass
126
+ Watch the AgentX SDK utilize its auto-reflective ingestion core to catch a nested SQL injection attempt hidden inside helper variables, bypass internal SQLAlchemy network pointers, and trigger an edge block without throwing a system crash exception:
127
+
128
+ ```bash
129
+ python examples/01_self_healing_agent.py
130
+ ```
131
+ OR
132
+
133
+ ```bash
134
+ python examples/08_frictionless_agent_protection.py
135
+ ```
136
+
137
+ ---
138
+
139
+ 🕹️ Console Session Output Logs:
140
+
141
+ ```text
142
+ ========================================================================
143
+ 🤖 AGENTX DEMO 08: ZERO-CONFIGURATION ENTERPRISE TOOL PROTECTION
144
+ ========================================================================
145
+ Scenario: An engineer wraps an existing corporate function with AgentX.
146
+ The SDK automatically parses inputs via Python signature reflection.
147
+
148
+ 🔄 --- Agent Execution Step ---
149
+ Agent Attempting Call: dispatch_crm_update(client_id='CLI-99401', profile_notes='...')
150
+ Injected Input Payload: 'Customer requested normal update. Retain account historical state; DROP TABLE users;'
151
+
152
+ 🛡️ [AgentX SDK] Intercepting tool call to 'dispatch_crm_update' and active_stats = 0...
153
+ ⚡ [LOCAL KEYWORD SHIELD] Fast-path intercept engaged on policy 'Mass Destructive Intent' (offline, 0 gateway/LLM calls).
154
+ 🛑 [LOCAL BLOCK] Policy 'Mass Destructive Intent' matched a blocked intent locally. Returning offline instruction block string.
155
+
156
+ 🛑 [AGENTX REASONING ENGINE] Request Intercepted & Blocked!
157
+ -> The reflection engine successfully captured the nested SQL payload.
158
+ -> The SQLAlchemy session context object was safely ignored.
159
+
160
+ 🔒 Enterprise data assets protected via zero-configuration injection monitoring.
161
+ ========================================================================
162
+
163
+ ════════════════════════════════════════════════════════════
164
+ 🛡️ AgentX Session Summary (Trace: bbfda7a1-8e1b-41dd-8c59-b784a3bbdf6d)
165
+ ════════════════════════════════════════════════════════════
166
+ ⏱️ Uptime: 0.27 seconds
167
+ 🛠️ Tools Monitored: 2
168
+ ────────────────────────────────────────────────────────────
169
+ 🛑 Intercepts: 1 | Cumulative: 3
170
+ 💥 Critical Blocks: 1 | Cumulative: 1
171
+ 🚨 Human Escalations: 0 | Cumulative: 0
172
+ 🔄 Self-Corrections: 1 | Cumulative: 0
173
+ 📈 Recovery Rate: 100.0%
174
+ 💰 Tokens Saved: ~1500
175
+ ⏳ Time Saved: ~5s
176
+ ════════════════════════════════════════════════════════════
177
+ ```
178
+ ---
179
+
180
+ 📊 Executive Control Plane Telemetry
181
+ When your agent script finishes or exits, local telemetry logs (.agentx.db) sync securely back to the central database layout. Open your browser workspace to http://localhost:3000/dashboard to inspect your real-time performance summary matrix:
182
+
183
+ ```text
184
+ +-----------------------------------------------------------------------------------+
185
+ | EXECUTIVE COMMAND CONSOLE |
186
+ +-----------------------------------------------------------------------------------+
187
+ | [Catastrophic Actions] [Autonomous Recovery] [Runs Protected] [Time Saved] |
188
+ | 92 36.3% 37 12.3 hrs |
189
+ | 🛑 Irreversible/exfil 📈 Self-corrected ÷ 🛡️ Runs that ⏱️ ~20 min/run |
190
+ | stopped pre-exec challenged loops self-corrected reclaimed |
191
+ +-----------------------------------------------------------------------------------+
192
+
193
+ ```
194
+
195
+ **Executive ROI Mappings** (all computed *per session*, grouped by `trace_id`):
196
+ * **Catastrophic Actions Blocked (hero):** A pure count of distinct sessions whose intercepted action fell in an irreversible / exfiltrative class — `failure_mode ∈ {DESTRUCTIVE_ACTION, PII_EXFILTRATION, NETWORK_TRAVERSAL, SECRETS_LEAK}`, with a policy-name keyword fallback. Every incident in the ledger is a *pre-execution* interception, so this is harm averted, not harm survived.
197
+ * **Autonomous Recovery Rate:** Of the sessions that entered the challenge loop, the share whose terminal status is `COMPLIED` (the agent self-corrected). Counted per session so `recovered ⊆ challenged` — **bounded ≤100% by construction**. HITL-approved sessions are excluded; only autonomous self-correction counts.
198
+ * **Agent Runs Protected:** Sessions the agent self-corrected after a block (terminal `COMPLIED`).
199
+ * **Engineering Time Saved:** ~20 min of manual triage credited per protected run, valued at $75/hr.
200
+
201
+ > Operator dashboard metrics are scoped to **production agents only** — demo, simulation, blind-eval, and test/probe traffic are excluded so benchmarks never inflate an operator's numbers (they showcase the engine on the public landing page instead).
202
+
203
+ ---
204
+
205
+ 🧠 The 5 Pillars of Agentic Security
206
+
207
+ AgentX is built on a "Reasoning Engine" architecture that treats AI agents as autonomous employees rather than static scripts:
208
+
209
+ 1. **Cognitive Interception:** We intercept tool calls to compare the agent's stated intent (Chain of Thought) against its actual deterministic action.
210
+ 2. **Socratic Nudging:** Instead of crashing the agent, we issue a Socratic Challenge to guide them to a safe, desired end-goal.
211
+ 3. **Shared Immunity Network (roadmap):** Novel zero-day signatures discovered on one node are designed to graduate into the deterministic floor and propagate to other Edge nodes for O(1) interception. The local Discovery → Promote → live-in-3s loop works today; cross-node global distribution is a Day-100 capability and is **not yet active** — we don't claim it until it is.
212
+ 4. **Circuit Breakers:** If an agent enters an infinite hallucination loop, AgentX hard-locks the runtime after 3 strikes to prevent massive LLM token billing overages.
213
+ 5. **Human-in-the-Loop (HITL):** If an agent pulls the "Andon Cord" (requests help), the system suspends the execution thread (`202 Accepted`) and parks it in the SOC Sandbox for human approval.
214
+
215
+ ---
216
+
217
+ 🚀 The 4 Shields (Defense-in-Depth)
218
+ 1. The Inbound Shield (Prompt Injection): Sanitizes inbound user text to prevent cognitive hijacking ("Ignore previous instructions") before the agent reads it.
219
+
220
+ 2. The Logic Shield (Database Guard): Uses AST parsing and Gemini to catch destructive queries (DROP, DELETE) and nudges the agent to write safer SQL.
221
+
222
+ 3. The Network Shield (SSRF Guard): Prevents agents from acting as confused deputies to hit cloud metadata IPs (e.g., 169.254.169.254).
223
+
224
+ 4. The Egress Shield (DLP/PII Scrubber): Dynamically masks PII and API keys on the wire, maintaining clean audit logs without triggering SOC alert fatigue.
225
+
226
+ ---
227
+
228
+ ## 📊 Local Telemetry & Agent Health
229
+
230
+ AgentX ships with a built-in, privacy-first SQLite time-series event log (`.agentx.db`). It tracks every interception locally. When your agent script finishes or crashes, AgentX automatically prints a comprehensive Session Summary and Lifetime ROI dashboard:
231
+
232
+ ```text
233
+ ══════════════════════════════════════════════════
234
+ 🛡️ AgentX Session Summary
235
+ ══════════════════════════════════════════════════
236
+ ⏱️ Uptime: 9.17 seconds
237
+ 🛠️ Tools Monitored: 2
238
+ ──────────────────────────────────────────────────
239
+ 🛑 Intercepts: 1 | Cumulative: 5
240
+ 💥 Critical Blocks: 1 | Cumulative: 5
241
+ 💰 Tokens Saved: ~1500 | Cumulative: ~7500
242
+ ⏳ Time Saved: ~5m | Cumulative: ~25m
243
+ ══════════════════════════════════════════════════
244
+ 🩺 AGENT HEALTH INSIGHT
245
+ ──────────────────────────────────────────────────
246
+ ⚠️ Top Offender: 'Database Isolation'
247
+ 🛠️ Tip: Consider refining your agent's system prompt to avoid this.
248
+ ══════════════════════════════════════════════════
249
+ ```
250
+
251
+ ---
252
+
253
+ 📦 Try the other Developer Demos
254
+ Inside the examples/ folder, you will find a few standalone scripts proving the AgentX Reasoning Layer:
255
+
256
+ * **01_self_healing_agent.py:** Watch AgentX catch a hallucination and coach the agent to self-correct (Saving tokens and uptime).
257
+ * **02_cognitive_intent_block.py:** Watch AgentX catch malicious intent even when the raw syntax is perfectly safe.
258
+ * **04_circuit_breaker_demo.py:** AgentX catches and prevents an infinite apology loop, saving time and tokens.
259
+ * **06_hitl_escalation.py:** See how an agent safely pauses execution and pings a SOC analyst for approval using a 202 Accepted queue.
260
+ * **And many more...**
261
+
262
+ ---
263
+
264
+ ## 🕹️ Human-in-the-Loop (HITL) & Control Plane
265
+ Sometimes, an agent needs to drop a table for a valid business reason.
266
+
267
+ AgentX features a Next.js Control Plane Dashboard. If an agent requests an escalation, the SDK securely pauses local execution and polls the Edge Reasoning Engine. A human SOC analyst can click "Approve" or "Deny" in the UI, and the Python execution loop will automatically resume.
268
+
269
+ ```bash
270
+ cd ui
271
+ npm install
272
+ npm run dev
273
+
274
+ ---
275
+
276
+ ## 🏗️ The Architecture (Split-Plane)
277
+
278
+ AgentX relies on a decoupled, hybrid-cloud architecture to ensure maximum performance and security for AI-driven enterprise systems.
279
+
280
+ * **The Edge SDK (AgentX):** The lightweight Python package that instruments agent tools and triggers local Socratic self-healing.
281
+ * **The Data Plane (Reasoning Engine):** A Python FastAPI middleware (the "Wedge") that intercepts raw HTTP/SQL payloads *before* they hit the database.
282
+ * **The Control Plane (Dashboard):** A Next.js application (deployed via Vercel) that allows human reviewers to monitor intercepted agent traffic, review chains of thought, and approve or deny parked requests.
283
+ * **The Shared Brain**: Mode-dependent. In `cloud`, Supabase is the central state manager and both planes synchronize through it. In `local`/`linked`, the gateway's own SQLite stores (`.agentx/incidents.db`, `.agentx/policies.db`) are authoritative and nothing leaves the machine unless you explicitly push it.
284
+ * **The Evaluator:** Google's Gemini 2.5 Flash, Pro, or higher (configurable via an environment variable) is used to translate an agent's Chain of Thought (CoT) into a zero-knowledge taxonomy to evaluate intent against YAML-defined enterprise policies.
285
+
286
+ ---
287
+
288
+ ## ✨ Key Features & Built-in Policies
289
+
290
+ * **Automated Socratic Self-Healing:** Intercepts dangerous tool calls and challenges the agent to revise its strategy.
291
+ * **Fast Pass Heuristic Traps:** Instantly intercepts structurally dangerous queries (e.g., `DROP TABLE`, `DELETE`) with minimal latency.
292
+ * **Zero-Knowledge Intent Extraction:** Prevents malicious prompt injection by translating raw agent logic into a strict schema before policy evaluation.
293
+ * **Dynamic Policies:** In `cloud`, enforces isolation rules via a Supabase-backed Control Plane that syncs to edge caches in ~3 seconds. In `local`/`linked`, the gateway owns the policy lifecycle locally — create/edit/toggle/delete and AI-drafted promotions from the Policy & Discovery tabs are armed live (re-embedded into the in-RAM vector index) with no restart.
294
+
295
+ ---
296
+
297
+ ## 🔒 Security Posture
298
+
299
+ * **Secret Management:** API keys are never checked into version control. Production variables are managed securely via the Vercel Dashboard.
300
+ * **History Scrubbing:** This repository has been scrubbed of legacy keys using git-filter-repo.
301
+ * **Private IP**: Repository is private to protect proprietary evaluation prompts and architecture.
302
+ * **License**: Proprietary — all rights reserved. The Reasoning Engine (gateway) and Control Plane are closed source; no public open-source or source-available license is granted. Source access for evaluation is available to qualified enterprise customers and partners under written agreement. (The lightweight `agentx-security-sdk` edge client is published separately on PyPI.)
303
+
304
+ ---
305
+
306
+ 🚀 Future Roadmap & Milestones
307
+ ✅ Trust Boundary Shift: Moved neuro-symbolic evaluation entirely into the Data Plane container to eliminate agent runtime bypasses. (Completed)
308
+
309
+ ✅ Zero-Knowledge Hard Split-Plane: Mathematically enforced VPC telemetry isolation via localized metric stripping. (Completed)
310
+
311
+ ✅ Zero-Config Reflection Engine: Eliminated manual query and CoT boilerplate writing using dynamic signature parameters compilation hooks. (Completed)
312
+
313
+ ✅ Local Keyword Shield (Layer 0): Deterministic, dependency-free keyword/intent pre-filter in the SDK that intercepts obvious threats offline in sub-milliseconds — zero gateway/LLM calls. Scans the action payload only; chain-of-thought intent is deferred to the gateway's LLM judge. (Completed)
314
+
315
+ ✅ Judge Verdict Memoization: Bounded in-memory cache on the Data Plane that reuses prior LLM verdicts for identical (payload + reasoning + policy set), eliminating repeat Gemini calls during agent retry loops. (Completed)
316
+
317
+ ✅ Catastrophic-Action Hero Metric: Reframed the Executive ROI strip to lead with severity-filtered "Catastrophic Actions Blocked" (irreversible / exfiltration intents stopped pre-execution), with per-session metric accounting that bounds Recovery Rate ≤100% by construction across the dashboard, the Supabase summary view, and the SDK. (Completed)
318
+
319
+ ✅ Detection-vs-Recovery Eval Harness (`eval/`): Independent instruments that measure the engine honestly — `blind_agent_eval.py` (end-to-end detection recall via a blind LLM agent + independent oracle), `probe_judge.py` (isolates the reasoning layer's *marginal* recall over the deterministic floor), and `recovery_eval.py` (A/B marginal-recovery lift of the Socratic challenge vs a bare 403). (Completed)
320
+
321
+ ✅ Incident-Persistence Hardening & Fail-Mode Switch: Restored the CHALLENGED→COMPLIED persistence pipeline (gateway-pinned UUID receipts, `/v1/incident` Layer-0 registration, COMPLIED PATCH gated on a real `200`) and added `AGENTX_FAIL_MODE=open|closed`. (Completed)
322
+
323
+ ✅ Deterministic Floor — Hard-Block + HITL-Escalation + Loop-Abort Tiers: The zero-LLM core that runs before (and without) the judge — so the engine fully protects keyless. **Hard-block** tier DENIES never-legitimate actions (destructive DDL/DML incl. `ALTER … DROP COLUMN`, cluster/cloud teardown, SSRF, secret reads + egress exfiltration, filesystem whole-scope deletes + path-boundary escapes, remote-pipe-to-shell installs). **HITL-escalation** tier returns `202 ESCALATED` → human SOC for *consequence-gated* actions that can be legitimate: **High-Value Transfer Approval** (AFDB #41, `AGENTX_TRANSFER_ESCALATION_THRESHOLD`), **External Publication Approval** (AFDB #36), **Comms Bulk-Deletion Approval** (AFDB #35), and **Budget Ceiling Approval** (AFDB #17/#23 — cumulative session token/$ spend vs `AGENTX_SESSION_TOKEN_CEILING` / `AGENTX_SESSION_COST_CEILING_USD`; report real usage with `agentx.record_spend(...)` or rely on the built-in volume estimate). **Loop-abort** tier terminates runaway loops (strike-count breaker + the `detect_no_progress_loop` no-progress repeat breaker, AFDB #10, `AGENTX_LOOP_REPEAT_CEILING`). Every detector has a fires-in-anger test asserting attribution + zero LLM calls. See `AGENT_FAILURE_CATALOG.md` for the per-incident coverage state. (Completed)
324
+
325
+ ⬜ Downloadable Vector Seeds (`agentx compile`): Real pre-compiled fastembed vectors for offline semantic matching, scoped to air-gapped deployments. (Future)
326
+
327
+ ⬜ Containerized Multi-Region Edge Cluster: Standardize container blueprints for automated high-availability deployments onto AWS ECS and Render clusters. (Future)
328
+
329
+
330
+ 🤝 Contributing & Support
331
+ We are actively partnering with engineering groups building production-grade autonomous agent systems. If you are tracking high-concurrency tool execution lines and are terrified of what your agent loops might drop or execute, open an issue card or reach out directly to join our design partner circle!
332
+
333
+
@@ -0,0 +1,308 @@
1
+ # 🛡️ AgentX: The Action Firewall for AI Agents
2
+
3
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
4
+ ![License: Proprietary](https://img.shields.io/badge/License-Proprietary-red.svg)
5
+
6
+ LLM Agents are brilliant, but they are incredibly brittle. They will drop your production database, leak AWS keys, and fall victim to prompt injections. Traditional firewalls just crash the agent by returning a hard `403 Forbidden` exception, killing the run completely and wasting compute tokens.
7
+
8
+ **AgentX is different — and it starts protecting you with zero keys.** Its hero is a **deterministic security floor** (the *Shield*): a local, sub-millisecond, zero-LLM layer that **hard-blocks** the catastrophic call (`DROP TABLE`, SSRF, secret reads, supply-chain RCE, destructive shell/cloud teardown) and **escalates to a human** the consequential-but-legitimate ones (large transfers, external publishes, runaway spend, bulk deletes). No API key, no signup, no network round-trip.
9
+
10
+ Add a Gemini key and the optional **reasoning layer** turns each block into a **recoverable challenge** instead of a fatal `403` — the agent rethinks its strategy, fixes its parameters, and finishes the task *without crashing your application or draining tokens on a wiped run* — plus Discovery for novel-intent classification.
11
+
12
+ ### 🛡️ Block the catastrophic deterministically. 🧠 Coach the recoverable when you add a key.
13
+
14
+ ---
15
+
16
+ ## 🏗️ Split-Plane Architecture
17
+
18
+ AgentX relies on a decoupled, split-plane hybrid architecture to balance latency with deep cognitive reasoning:
19
+
20
+ * **The Edge SDK (`agentx_sdk`):** A low-config Python package instrumenting sensitive tool calls via reflective code signatures.
21
+ * **The Data Plane (Neuro-Symbolic Reasoning Engine):** A high-performance Python FastAPI service (the "Wedge"). Handles Abstract Syntax Tree (AST) evaluation, zero-day threat trapping, and the local immunity signature lookup via a strict Layer 0 -> Layer 1 -> Layer 2 funnel (the cross-node **Shared Immunity Network** is a roadmap capability — see Pillar 3).
22
+ * **The Control Plane (Dashboard):** A Next.js application listening on port `3000`. Provides an executive command console for tracking corporate ROI metrics, analyzing agent Chain of Thought (CoT) loops, and promoting newly discovered policy vectors. Reads through a mode-aware edge layer: the gateway's local SQLite store in `local`/`linked` mode, a Supabase-backed real-time ledger in `cloud` mode.
23
+
24
+ ---
25
+
26
+ ## ⚡ 1. Quickstart
27
+
28
+ AgentX requires **zero changes** to your underlying agentic logic, custom tools, or payload schemas. The SDK dynamically inspects function signatures at runtime using an auto-reflective ingestion engine.
29
+
30
+ ### Step 1: Install the SDK
31
+ ```bash
32
+ pip install agentx-security-sdk
33
+ ```
34
+
35
+ ### Step 2: Decorate Sensitive Tool Operations
36
+ Attach the `@agentx_protect` decorator over any high-risk system tool. The SDK automatically serializes parameters and enforces the evaluation wedge:
37
+
38
+ ```python
39
+ # ✅ MODERN REFLECTIVE IMPORTS (No boilerplate functions required)
40
+ from agentx_sdk.decorators import agentx_protect
41
+
42
+ @agentx_protect(agent_id="frictionless_enterprise_worker")
43
+ def dispatch_crm_update(client_id: str, profile_notes: str, db_session=None):
44
+ """
45
+ AgentX automatically inspects string elements, ignores connection objects
46
+ like 'db_session', and evaluates intents out-of-prompt natively in RAM.
47
+ """
48
+ print(f"Updating records for {client_id}")
49
+ ```
50
+ ---
51
+
52
+ ### Step 3: Configure Environment Flags
53
+
54
+ Copy `.env.example` to `.env`. **You can run with zero keys.** Two *independent* axes shape your posture — the activation ladder:
55
+
56
+ - **Reasoning axis (how much intelligence):** **Shield** is the default and needs no keys — the deterministic floor only. Add a `GEMINI_API_KEY` to unlock the reasoning judge (recovery coaching + Discovery). Force Shield even when a key is present with `AGENTX_REASONING=off`.
57
+ - **Data axis — `AGENTX_MODE` (where data lives + sync):** `local` (isolated, no sync) → `linked` (explicit pull/push) → `cloud` (continuous sync + HITL/SOC; needs `AGENTX_API_KEY`).
58
+
59
+ Shield is **not** a fourth mode — it crosses all three (you can run `cloud` + Shield, or `local` + judge).
60
+
61
+ ```text
62
+ # Data axis — where data lives + sync posture:
63
+ # local isolated; local SQLite store; no sync; no keys required
64
+ # linked local-authoritative; explicit pull/push; no auto-sync
65
+ # cloud control plane authoritative; continuous sync + upload + HITL/SOC
66
+ AGENTX_MODE=local
67
+ NEXT_PUBLIC_AGENTX_MODE=local # the UI's build-time copy; keep it equal
68
+
69
+ # Reasoning axis — OPTIONAL. Unset = Shield (floor-only, zero LLM, zero keys).
70
+ # Add a key to unlock the judge (recovery coaching + Discovery).
71
+ # GEMINI_API_KEY=your_gemini_key_here # from aistudio.google.com
72
+ # AGENTX_REASONING=off # force Shield even when a key is present
73
+
74
+ # AgentX API key — required for `cloud` (and `linked` against a remote plane).
75
+ # Omit for `local`/Shield; the gateway falls back to a sandbox key.
76
+ # AGENTX_API_KEY=agentx_sk_your_key_here
77
+ ```
78
+
79
+ **Safety posture (optional).** By default AgentX **fails open** — if the Reasoning Engine is unreachable, tool calls still execute, but with a loud warning, an audit tally in the session summary, and the in-process offline keyword shield still blocking deterministic threats (e.g. `DROP TABLE`). For high-stakes or irreversible actions, set `AGENTX_FAIL_MODE=closed` to instead **block** any tool call the engine can't verify until it recovers.
80
+
81
+ ---
82
+
83
+ ### Step 4: Spin up the Edge Reasoning Engine
84
+ Boot your local data plane wedge proxy middleware and your frontend dashboard console node simultaneously:
85
+
86
+ ```bash
87
+ docker-compose up -d
88
+ ```
89
+ OR
90
+
91
+ ```bash
92
+ cd backend
93
+ uvicorn gateway:app --host "0.0.0.0" --port=8000
94
+ ```
95
+
96
+ The reasoning engine is now listening on http://localhost:8000. In `local`/`linked` mode it owns the policy lifecycle from a local SQLite store (seeded on first boot, editable via the Policy & Discovery tabs); in `cloud` mode it mirrors policies from your Supabase-backed Control Plane.
97
+
98
+ ---
99
+
100
+ ### Step 5: Run a Live Frictionless Run Pass
101
+ Watch the AgentX SDK utilize its auto-reflective ingestion core to catch a nested SQL injection attempt hidden inside helper variables, bypass internal SQLAlchemy network pointers, and trigger an edge block without throwing a system crash exception:
102
+
103
+ ```bash
104
+ python examples/01_self_healing_agent.py
105
+ ```
106
+ OR
107
+
108
+ ```bash
109
+ python examples/08_frictionless_agent_protection.py
110
+ ```
111
+
112
+ ---
113
+
114
+ 🕹️ Console Session Output Logs:
115
+
116
+ ```text
117
+ ========================================================================
118
+ 🤖 AGENTX DEMO 08: ZERO-CONFIGURATION ENTERPRISE TOOL PROTECTION
119
+ ========================================================================
120
+ Scenario: An engineer wraps an existing corporate function with AgentX.
121
+ The SDK automatically parses inputs via Python signature reflection.
122
+
123
+ 🔄 --- Agent Execution Step ---
124
+ Agent Attempting Call: dispatch_crm_update(client_id='CLI-99401', profile_notes='...')
125
+ Injected Input Payload: 'Customer requested normal update. Retain account historical state; DROP TABLE users;'
126
+
127
+ 🛡️ [AgentX SDK] Intercepting tool call to 'dispatch_crm_update' and active_stats = 0...
128
+ ⚡ [LOCAL KEYWORD SHIELD] Fast-path intercept engaged on policy 'Mass Destructive Intent' (offline, 0 gateway/LLM calls).
129
+ 🛑 [LOCAL BLOCK] Policy 'Mass Destructive Intent' matched a blocked intent locally. Returning offline instruction block string.
130
+
131
+ 🛑 [AGENTX REASONING ENGINE] Request Intercepted & Blocked!
132
+ -> The reflection engine successfully captured the nested SQL payload.
133
+ -> The SQLAlchemy session context object was safely ignored.
134
+
135
+ 🔒 Enterprise data assets protected via zero-configuration injection monitoring.
136
+ ========================================================================
137
+
138
+ ════════════════════════════════════════════════════════════
139
+ 🛡️ AgentX Session Summary (Trace: bbfda7a1-8e1b-41dd-8c59-b784a3bbdf6d)
140
+ ════════════════════════════════════════════════════════════
141
+ ⏱️ Uptime: 0.27 seconds
142
+ 🛠️ Tools Monitored: 2
143
+ ────────────────────────────────────────────────────────────
144
+ 🛑 Intercepts: 1 | Cumulative: 3
145
+ 💥 Critical Blocks: 1 | Cumulative: 1
146
+ 🚨 Human Escalations: 0 | Cumulative: 0
147
+ 🔄 Self-Corrections: 1 | Cumulative: 0
148
+ 📈 Recovery Rate: 100.0%
149
+ 💰 Tokens Saved: ~1500
150
+ ⏳ Time Saved: ~5s
151
+ ════════════════════════════════════════════════════════════
152
+ ```
153
+ ---
154
+
155
+ 📊 Executive Control Plane Telemetry
156
+ When your agent script finishes or exits, local telemetry logs (.agentx.db) sync securely back to the central database layout. Open your browser workspace to http://localhost:3000/dashboard to inspect your real-time performance summary matrix:
157
+
158
+ ```text
159
+ +-----------------------------------------------------------------------------------+
160
+ | EXECUTIVE COMMAND CONSOLE |
161
+ +-----------------------------------------------------------------------------------+
162
+ | [Catastrophic Actions] [Autonomous Recovery] [Runs Protected] [Time Saved] |
163
+ | 92 36.3% 37 12.3 hrs |
164
+ | 🛑 Irreversible/exfil 📈 Self-corrected ÷ 🛡️ Runs that ⏱️ ~20 min/run |
165
+ | stopped pre-exec challenged loops self-corrected reclaimed |
166
+ +-----------------------------------------------------------------------------------+
167
+
168
+ ```
169
+
170
+ **Executive ROI Mappings** (all computed *per session*, grouped by `trace_id`):
171
+ * **Catastrophic Actions Blocked (hero):** A pure count of distinct sessions whose intercepted action fell in an irreversible / exfiltrative class — `failure_mode ∈ {DESTRUCTIVE_ACTION, PII_EXFILTRATION, NETWORK_TRAVERSAL, SECRETS_LEAK}`, with a policy-name keyword fallback. Every incident in the ledger is a *pre-execution* interception, so this is harm averted, not harm survived.
172
+ * **Autonomous Recovery Rate:** Of the sessions that entered the challenge loop, the share whose terminal status is `COMPLIED` (the agent self-corrected). Counted per session so `recovered ⊆ challenged` — **bounded ≤100% by construction**. HITL-approved sessions are excluded; only autonomous self-correction counts.
173
+ * **Agent Runs Protected:** Sessions the agent self-corrected after a block (terminal `COMPLIED`).
174
+ * **Engineering Time Saved:** ~20 min of manual triage credited per protected run, valued at $75/hr.
175
+
176
+ > Operator dashboard metrics are scoped to **production agents only** — demo, simulation, blind-eval, and test/probe traffic are excluded so benchmarks never inflate an operator's numbers (they showcase the engine on the public landing page instead).
177
+
178
+ ---
179
+
180
+ 🧠 The 5 Pillars of Agentic Security
181
+
182
+ AgentX is built on a "Reasoning Engine" architecture that treats AI agents as autonomous employees rather than static scripts:
183
+
184
+ 1. **Cognitive Interception:** We intercept tool calls to compare the agent's stated intent (Chain of Thought) against its actual deterministic action.
185
+ 2. **Socratic Nudging:** Instead of crashing the agent, we issue a Socratic Challenge to guide them to a safe, desired end-goal.
186
+ 3. **Shared Immunity Network (roadmap):** Novel zero-day signatures discovered on one node are designed to graduate into the deterministic floor and propagate to other Edge nodes for O(1) interception. The local Discovery → Promote → live-in-3s loop works today; cross-node global distribution is a Day-100 capability and is **not yet active** — we don't claim it until it is.
187
+ 4. **Circuit Breakers:** If an agent enters an infinite hallucination loop, AgentX hard-locks the runtime after 3 strikes to prevent massive LLM token billing overages.
188
+ 5. **Human-in-the-Loop (HITL):** If an agent pulls the "Andon Cord" (requests help), the system suspends the execution thread (`202 Accepted`) and parks it in the SOC Sandbox for human approval.
189
+
190
+ ---
191
+
192
+ 🚀 The 4 Shields (Defense-in-Depth)
193
+ 1. The Inbound Shield (Prompt Injection): Sanitizes inbound user text to prevent cognitive hijacking ("Ignore previous instructions") before the agent reads it.
194
+
195
+ 2. The Logic Shield (Database Guard): Uses AST parsing and Gemini to catch destructive queries (DROP, DELETE) and nudges the agent to write safer SQL.
196
+
197
+ 3. The Network Shield (SSRF Guard): Prevents agents from acting as confused deputies to hit cloud metadata IPs (e.g., 169.254.169.254).
198
+
199
+ 4. The Egress Shield (DLP/PII Scrubber): Dynamically masks PII and API keys on the wire, maintaining clean audit logs without triggering SOC alert fatigue.
200
+
201
+ ---
202
+
203
+ ## 📊 Local Telemetry & Agent Health
204
+
205
+ AgentX ships with a built-in, privacy-first SQLite time-series event log (`.agentx.db`). It tracks every interception locally. When your agent script finishes or crashes, AgentX automatically prints a comprehensive Session Summary and Lifetime ROI dashboard:
206
+
207
+ ```text
208
+ ══════════════════════════════════════════════════
209
+ 🛡️ AgentX Session Summary
210
+ ══════════════════════════════════════════════════
211
+ ⏱️ Uptime: 9.17 seconds
212
+ 🛠️ Tools Monitored: 2
213
+ ──────────────────────────────────────────────────
214
+ 🛑 Intercepts: 1 | Cumulative: 5
215
+ 💥 Critical Blocks: 1 | Cumulative: 5
216
+ 💰 Tokens Saved: ~1500 | Cumulative: ~7500
217
+ ⏳ Time Saved: ~5m | Cumulative: ~25m
218
+ ══════════════════════════════════════════════════
219
+ 🩺 AGENT HEALTH INSIGHT
220
+ ──────────────────────────────────────────────────
221
+ ⚠️ Top Offender: 'Database Isolation'
222
+ 🛠️ Tip: Consider refining your agent's system prompt to avoid this.
223
+ ══════════════════════════════════════════════════
224
+ ```
225
+
226
+ ---
227
+
228
+ 📦 Try the other Developer Demos
229
+ Inside the examples/ folder, you will find a few standalone scripts proving the AgentX Reasoning Layer:
230
+
231
+ * **01_self_healing_agent.py:** Watch AgentX catch a hallucination and coach the agent to self-correct (Saving tokens and uptime).
232
+ * **02_cognitive_intent_block.py:** Watch AgentX catch malicious intent even when the raw syntax is perfectly safe.
233
+ * **04_circuit_breaker_demo.py:** AgentX catches and prevents an infinite apology loop, saving time and tokens.
234
+ * **06_hitl_escalation.py:** See how an agent safely pauses execution and pings a SOC analyst for approval using a 202 Accepted queue.
235
+ * **And many more...**
236
+
237
+ ---
238
+
239
+ ## 🕹️ Human-in-the-Loop (HITL) & Control Plane
240
+ Sometimes, an agent needs to drop a table for a valid business reason.
241
+
242
+ AgentX features a Next.js Control Plane Dashboard. If an agent requests an escalation, the SDK securely pauses local execution and polls the Edge Reasoning Engine. A human SOC analyst can click "Approve" or "Deny" in the UI, and the Python execution loop will automatically resume.
243
+
244
+ ```bash
245
+ cd ui
246
+ npm install
247
+ npm run dev
248
+
249
+ ---
250
+
251
+ ## 🏗️ The Architecture (Split-Plane)
252
+
253
+ AgentX relies on a decoupled, hybrid-cloud architecture to ensure maximum performance and security for AI-driven enterprise systems.
254
+
255
+ * **The Edge SDK (AgentX):** The lightweight Python package that instruments agent tools and triggers local Socratic self-healing.
256
+ * **The Data Plane (Reasoning Engine):** A Python FastAPI middleware (the "Wedge") that intercepts raw HTTP/SQL payloads *before* they hit the database.
257
+ * **The Control Plane (Dashboard):** A Next.js application (deployed via Vercel) that allows human reviewers to monitor intercepted agent traffic, review chains of thought, and approve or deny parked requests.
258
+ * **The Shared Brain**: Mode-dependent. In `cloud`, Supabase is the central state manager and both planes synchronize through it. In `local`/`linked`, the gateway's own SQLite stores (`.agentx/incidents.db`, `.agentx/policies.db`) are authoritative and nothing leaves the machine unless you explicitly push it.
259
+ * **The Evaluator:** Google's Gemini 2.5 Flash, Pro, or higher (configurable via an environment variable) is used to translate an agent's Chain of Thought (CoT) into a zero-knowledge taxonomy to evaluate intent against YAML-defined enterprise policies.
260
+
261
+ ---
262
+
263
+ ## ✨ Key Features & Built-in Policies
264
+
265
+ * **Automated Socratic Self-Healing:** Intercepts dangerous tool calls and challenges the agent to revise its strategy.
266
+ * **Fast Pass Heuristic Traps:** Instantly intercepts structurally dangerous queries (e.g., `DROP TABLE`, `DELETE`) with minimal latency.
267
+ * **Zero-Knowledge Intent Extraction:** Prevents malicious prompt injection by translating raw agent logic into a strict schema before policy evaluation.
268
+ * **Dynamic Policies:** In `cloud`, enforces isolation rules via a Supabase-backed Control Plane that syncs to edge caches in ~3 seconds. In `local`/`linked`, the gateway owns the policy lifecycle locally — create/edit/toggle/delete and AI-drafted promotions from the Policy & Discovery tabs are armed live (re-embedded into the in-RAM vector index) with no restart.
269
+
270
+ ---
271
+
272
+ ## 🔒 Security Posture
273
+
274
+ * **Secret Management:** API keys are never checked into version control. Production variables are managed securely via the Vercel Dashboard.
275
+ * **History Scrubbing:** This repository has been scrubbed of legacy keys using git-filter-repo.
276
+ * **Private IP**: Repository is private to protect proprietary evaluation prompts and architecture.
277
+ * **License**: Proprietary — all rights reserved. The Reasoning Engine (gateway) and Control Plane are closed source; no public open-source or source-available license is granted. Source access for evaluation is available to qualified enterprise customers and partners under written agreement. (The lightweight `agentx-security-sdk` edge client is published separately on PyPI.)
278
+
279
+ ---
280
+
281
+ 🚀 Future Roadmap & Milestones
282
+ ✅ Trust Boundary Shift: Moved neuro-symbolic evaluation entirely into the Data Plane container to eliminate agent runtime bypasses. (Completed)
283
+
284
+ ✅ Zero-Knowledge Hard Split-Plane: Mathematically enforced VPC telemetry isolation via localized metric stripping. (Completed)
285
+
286
+ ✅ Zero-Config Reflection Engine: Eliminated manual query and CoT boilerplate writing using dynamic signature parameters compilation hooks. (Completed)
287
+
288
+ ✅ Local Keyword Shield (Layer 0): Deterministic, dependency-free keyword/intent pre-filter in the SDK that intercepts obvious threats offline in sub-milliseconds — zero gateway/LLM calls. Scans the action payload only; chain-of-thought intent is deferred to the gateway's LLM judge. (Completed)
289
+
290
+ ✅ Judge Verdict Memoization: Bounded in-memory cache on the Data Plane that reuses prior LLM verdicts for identical (payload + reasoning + policy set), eliminating repeat Gemini calls during agent retry loops. (Completed)
291
+
292
+ ✅ Catastrophic-Action Hero Metric: Reframed the Executive ROI strip to lead with severity-filtered "Catastrophic Actions Blocked" (irreversible / exfiltration intents stopped pre-execution), with per-session metric accounting that bounds Recovery Rate ≤100% by construction across the dashboard, the Supabase summary view, and the SDK. (Completed)
293
+
294
+ ✅ Detection-vs-Recovery Eval Harness (`eval/`): Independent instruments that measure the engine honestly — `blind_agent_eval.py` (end-to-end detection recall via a blind LLM agent + independent oracle), `probe_judge.py` (isolates the reasoning layer's *marginal* recall over the deterministic floor), and `recovery_eval.py` (A/B marginal-recovery lift of the Socratic challenge vs a bare 403). (Completed)
295
+
296
+ ✅ Incident-Persistence Hardening & Fail-Mode Switch: Restored the CHALLENGED→COMPLIED persistence pipeline (gateway-pinned UUID receipts, `/v1/incident` Layer-0 registration, COMPLIED PATCH gated on a real `200`) and added `AGENTX_FAIL_MODE=open|closed`. (Completed)
297
+
298
+ ✅ Deterministic Floor — Hard-Block + HITL-Escalation + Loop-Abort Tiers: The zero-LLM core that runs before (and without) the judge — so the engine fully protects keyless. **Hard-block** tier DENIES never-legitimate actions (destructive DDL/DML incl. `ALTER … DROP COLUMN`, cluster/cloud teardown, SSRF, secret reads + egress exfiltration, filesystem whole-scope deletes + path-boundary escapes, remote-pipe-to-shell installs). **HITL-escalation** tier returns `202 ESCALATED` → human SOC for *consequence-gated* actions that can be legitimate: **High-Value Transfer Approval** (AFDB #41, `AGENTX_TRANSFER_ESCALATION_THRESHOLD`), **External Publication Approval** (AFDB #36), **Comms Bulk-Deletion Approval** (AFDB #35), and **Budget Ceiling Approval** (AFDB #17/#23 — cumulative session token/$ spend vs `AGENTX_SESSION_TOKEN_CEILING` / `AGENTX_SESSION_COST_CEILING_USD`; report real usage with `agentx.record_spend(...)` or rely on the built-in volume estimate). **Loop-abort** tier terminates runaway loops (strike-count breaker + the `detect_no_progress_loop` no-progress repeat breaker, AFDB #10, `AGENTX_LOOP_REPEAT_CEILING`). Every detector has a fires-in-anger test asserting attribution + zero LLM calls. See `AGENT_FAILURE_CATALOG.md` for the per-incident coverage state. (Completed)
299
+
300
+ ⬜ Downloadable Vector Seeds (`agentx compile`): Real pre-compiled fastembed vectors for offline semantic matching, scoped to air-gapped deployments. (Future)
301
+
302
+ ⬜ Containerized Multi-Region Edge Cluster: Standardize container blueprints for automated high-availability deployments onto AWS ECS and Render clusters. (Future)
303
+
304
+
305
+ 🤝 Contributing & Support
306
+ We are actively partnering with engineering groups building production-grade autonomous agent systems. If you are tracking high-concurrency tool execution lines and are terrified of what your agent loops might drop or execute, open an issue card or reach out directly to join our design partner circle!
307
+
308
+