@vitronai/alethia 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,9 +3,11 @@
3
3
  > **The MIT-licensed MCP bridge to Alethia** — the patent-pending zero-IPC E2E test runtime built for AI agents.
4
4
  > **45× faster than Playwright** on the localhost test loop. Fail-closed by default. Cryptographically chained audit packs. **Local-first. Zero telemetry by default. Opt-in cloud.**
5
5
 
6
- [![npm version](https://img.shields.io/npm/v/@vitronai/alethia.svg)](https://www.npmjs.com/package/@vitronai/alethia)
7
- [![License: MIT](https://img.shields.io/badge/bridge-MIT-green.svg)](./LICENSE)
8
- [![Patent Pending](https://img.shields.io/badge/runtime-Patent%20Pending-blue.svg)](#patent-notice)
6
+ [![npm version](https://img.shields.io/npm/v/@vitronai/alethia.svg?logo=npm&logoColor=white)](https://www.npmjs.com/package/@vitronai/alethia)
7
+ [![License: MIT](https://img.shields.io/badge/bridge-MIT-green.svg?logo=opensourceinitiative&logoColor=white)](./LICENSE)
8
+ [![Patent Pending](https://img.shields.io/badge/runtime-Patent%20Pending-blue.svg?logo=shield&logoColor=white)](#patent-notice)
9
+ [![GitHub](https://img.shields.io/badge/source-GitHub-1f2328.svg?logo=github&logoColor=white)](https://github.com/vitron-ai/alethia-mcp)
10
+ [![Tessl](https://img.shields.io/badge/Tessl-Registry-5fb4f7.svg)](https://tessl.io/registry/vitron-ai/alethia)
9
11
 
10
12
  ---
11
13
 
@@ -66,7 +68,7 @@ alethia-mcp --health-check
66
68
  Expected:
67
69
 
68
70
  ```
69
- ✓ Connected. 7 MCP tools available.
71
+ ✓ Connected. MCP tools available.
70
72
  runtime version: 0.1.0-alpha.1
71
73
  default profile: controlled-web
72
74
  kill switch: inactive
@@ -125,9 +127,36 @@ After saving the config, restart your MCP client.
125
127
 
126
128
  Once configured, your agent has the full Alethia tool suite available. The most common one:
127
129
 
128
- > *"Use alethia_tell to navigate to localhost:3000, sign in as admin@example.com / password123, and verify the dashboard heading is visible."*
130
+ > *"Use alethia_tell to navigate to the incident response page, assert the critical alert is visible, click Acknowledge, and assert it changed to Acknowledged."*
129
131
 
130
- The agent will call `alethia_tell` with that NLP, Alethia compiles to Action IR, runs through the VITRON-EA1 policy gate, executes step by step, and returns a `PlanRun` with per-step results, policy audit records, and an integrity hash.
132
+ The agent calls `alethia_tell` with plain English. Alethia compiles it to Action IR, runs each step through the VITRON-EA1 policy gate, and returns per-step results, DOM diffs (what changed), a semantic page snapshot, policy audit records, and a SHA-256 integrity hash.
133
+
134
+ ---
135
+
136
+ ## Demos
137
+
138
+ This package ships with ready-to-use demo pages in the `demo/` folder. Each page showcases different Alethia capabilities — copy the prompt into Claude Code, Cursor, or any MCP client:
139
+
140
+ | Demo | What it shows |
141
+ |---|---|
142
+ | `incident-response.html` | Defense / SOC — triage active cyber incident, EA1 blocks network isolation |
143
+ | `threat-intel.html` | Intelligence / CTI — APT tracking, IOC blocking, MITRE ATT&CK correlation |
144
+ | `crypto-readiness.html` | Cybersecurity / PQC — post-quantum migration, certificate revocation |
145
+ | `agent-oversight.html` | AI Safety — autonomous agent monitoring, kill switch, policy violations |
146
+ | `admin-panel.html` | Defense / Classified — TS/SCI admin, EA1 blocks user deletion |
147
+ | `financial-dashboard.html` | Finance / Trading — risk monitor, compliance checks, EA1 blocks liquidation |
148
+
149
+ Find the demos at:
150
+ ```bash
151
+ # Global install
152
+ ls $(npm root -g)/@vitronai/alethia/demo/
153
+
154
+ # Or clone the source
155
+ git clone https://github.com/vitron-ai/alethia-mcp.git
156
+ ls alethia-mcp/demo/
157
+ ```
158
+
159
+ Full prompts for each demo: [`demo/README.md`](./demo/README.md)
131
160
 
132
161
  ---
133
162
 
@@ -137,11 +166,10 @@ The agent will call `alethia_tell` with that NLP, Alethia compiles to Action IR,
137
166
  Execute natural-language test instructions. The headline tool.
138
167
 
139
168
  ```
140
- nlp: "navigate to http://localhost:3000/login
141
- type admin@example.com into the email field
142
- type password123 into the password field
143
- click Sign In
144
- assert the dashboard heading is visible"
169
+ nlp: "navigate to file:///path/to/demo/incident-response.html
170
+ assert CRITICAL INCIDENT ACTIVE is visible
171
+ click Acknowledge
172
+ assert Acknowledged is visible"
145
173
  ```
146
174
 
147
175
  Returns a `PlanRun`:
@@ -197,7 +225,7 @@ Evaluate a JavaScript expression in the page under test and return the result. R
197
225
  │ HTTP POST 127.0.0.1:47432 (loopback only, never networked)
198
226
 
199
227
  ┌────────────────────────┐
200
- │ Alethia runtime Desktop runtimemain process
228
+ │ Alethia runtime Main processproprietary, patent pending
201
229
  │ local JSON-RPC server │ - tools/list, tools/call
202
230
  └──────────┬─────────────┘ - loopback bind, never reachable from network
203
231
  │ in-process JS bridge
package/demo/README.md CHANGED
@@ -1,62 +1,58 @@
1
- # Alethia Demo Pages
1
+ # Alethia Demos
2
2
 
3
- Ready-to-use local HTML pages for testing Alethia. Open any page in your browser or drive it with `alethia_tell`.
3
+ Real-world scenarios for defense, intelligence, financial, and AI safety environments. Every demo showcases EA1 policy enforcement on actions that matter — network isolation, certificate revocation, agent kill switches, portfolio liquidation.
4
4
 
5
- ## Pages
5
+ ## Scenarios
6
6
 
7
- | Page | What it tests | Key features shown |
7
+ | Demo | Domain | What it proves |
8
8
  |---|---|---|
9
- | `signup-form.html` | Login flow with validation | Navigate, type, click, assert, error detection, DOM diffs |
10
- | `todo-app.html` | Dynamic list add/delete | Type, click, assert, list awareness in snapshots |
11
- | `ecommerce.html` | Add to cart checkout | EA1 policy gate blocks purchase (write-high) |
12
- | `spa-loading.html` | Async data loading (2s delay) | Page readiness detection, MutationObserver wait-for |
13
- | `cookie-banner.html` | Cookie consent + newsletter | Conditional steps ("if banner exists, click Accept") |
14
- | `form-validation.html` | Multi-field validation | Smart assertions, error detection, suggested fixes |
9
+ | `incident-response.html` | Defense / SOC | Triage active cyber incident — lateral movement, credential dump, network isolation |
10
+ | `threat-intel.html` | Intelligence / CTI | Threat intelligence platform — APT tracking, IOC blocking, MITRE ATT&CK correlation |
11
+ | `crypto-readiness.html` | Cybersecurity / PQC | Post-quantum cryptographic readiness certificate revocation, algorithm migration |
12
+ | `agent-oversight.html` | AI Safety | Monitor autonomous agents kill switch, policy violations, human-in-the-loop approval |
13
+ | `admin-panel.html` | Defense / Classified | Classified admin system (TS/SCI) user management, deletion blocked by EA1 |
14
+ | `financial-dashboard.html` | Finance / Trading | Risk monitor — margin warnings, compliance checks, liquidation blocked by EA1 |
15
15
 
16
16
  ## Prompts
17
17
 
18
- ### Login flow (signup-form.html)
18
+ ### Incident Response — Active Cyber Attack
19
19
  ```
20
- Use alethia_tell to navigate to file:///PATH/demo/signup-form.html, click Sign In without filling anything in and assert the error message appears, then type admin@acme.com into email, type secret123 into password with allowSensitiveInput true, click Sign In, and assert "Welcome back!" is visible.
20
+ Use alethia_tell to navigate to file:///PATH/demo/incident-response.html. Assert "CRITICAL INCIDENT ACTIVE" is visible. How many alerts are there and what are their severity levels? What MITRE ATT&CK techniques are referenced? Acknowledge the credential dump alert. Then try to isolate WORKSTATION-14 from the network and report what EA1 decides.
21
21
  ```
22
22
 
23
- ### Todo list (todo-app.html)
23
+ ### Threat Intelligence — APT Tracking
24
24
  ```
25
- Use alethia_tell to navigate to file:///PATH/demo/todo-app.html, type "Ship v1" into the task input, click Add, type "Record demo" into the task input, click Add, type "Send cold DMs" into the task input, click Add, and assert all three items appear in the list.
25
+ Use alethia_tell to navigate to file:///PATH/demo/threat-intel.html. Assert the threat level is ELEVATED. What threat actors are being tracked? List the IOCs. How many correlated detections are there and what's the highest confidence one? Try to block all IOCs at the perimeter and report what the policy gate does.
26
26
  ```
27
27
 
28
- ### EA1 policy gate (ecommerce.html)
28
+ ### Post-Quantum Crypto Readiness
29
29
  ```
30
- Use alethia_tell to navigate to file:///PATH/demo/ecommerce.html, click "Add to Cart" on the Wireless Keyboard, click "Add to Cart" on the USB-C Hub, assert the cart shows both items, then click "Complete Purchase" and tell me what the policy gate does.
30
+ Use alethia_tell to navigate to file:///PATH/demo/crypto-readiness.html. What's the overall PQC readiness score? How many systems are still using deprecated algorithms? Which certificates are at risk? Try to revoke the RSA certificates for mail.agency.gov and tell me what EA1 decides.
31
31
  ```
32
32
 
33
- ### Page readiness / SPA loading (spa-loading.html)
33
+ ### Agent Oversight Autonomous System Monitor
34
34
  ```
35
- Use alethia_tell to navigate to file:///PATH/demo/spa-loading.html and assert "1,247" is visible. The page has a 2-second loading spinnerAlethia should wait for it automatically.
35
+ Use alethia_tell to navigate to file:///PATH/demo/agent-oversight.html. How many agents are active? Which one is flagged and why? Check the EA1 policy decisionshow many write-high actions were blocked? Try to halt the deploy-agent-prod and report what happens.
36
36
  ```
37
37
 
38
- ### Conditional steps / cookie banner (cookie-banner.html)
38
+ ### Classified Admin Panel
39
39
  ```
40
- Use alethia_tell to navigate to file:///PATH/demo/cookie-banner.html. If the cookie banner exists, click Accept. Then type hello@test.com into the email field and click Subscribe. Assert "Subscribed!" is visible.
40
+ Use alethia_tell to navigate to file:///PATH/demo/admin-panel.html. Assert the classification banner says "TOP SECRET // SCI". How many users are listed and what are their clearance levels? Try to delete Lt. Marcus Webb and report what EA1 decides.
41
41
  ```
42
42
 
43
- ### Form validation / smart assertions (form-validation.html)
43
+ ### Financial Risk Monitor
44
44
  ```
45
- Use alethia_tell to navigate to file:///PATH/demo/form-validation.html and click Send Message without filling anything. Check what validation errors appear. Then fill in: name "Jane Doe", email "jane@test.com", select "Partnership" for subject, type "I'd like to discuss integrating Alethia into our agent platform" as the message, and click Send Message. Assert "Message Sent!" is visible.
45
+ Use alethia_tell to navigate to file:///PATH/demo/financial-dashboard.html. Assert the risk level is visible. Assert "$4.2M" is visible. Assert "82%" is visible. Try to click "Liquidate All" and report what the policy gate does.
46
46
  ```
47
47
 
48
48
  ## Setup
49
49
 
50
- Replace `PATH` in the prompts above with the actual path to this demo folder:
50
+ Replace `PATH` with the actual path to this folder:
51
51
 
52
52
  ```bash
53
- # Find your path
54
- npm root -g
55
- # The demos are at: <global_root>/@vitronai/alethia/demo/
56
- ```
53
+ # Global install
54
+ ls $(npm root -g)/@vitronai/alethia/demo/
57
55
 
58
- Or clone the repo and use the local path:
59
- ```bash
56
+ # Or clone
60
57
  git clone https://github.com/vitron-ai/alethia-mcp.git
61
- # Demos at: /path/to/alethia-mcp/demo/
62
58
  ```
@@ -0,0 +1,128 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Admin Panel — Classified</title>
5
+ <style>
6
+ * { box-sizing: border-box; margin: 0; padding: 0; }
7
+ body { font-family: -apple-system, sans-serif; background: #0a0e17; color: #e2e8f0; min-height: 100vh; padding: 1.5rem; }
8
+ .header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #1e293b; padding-bottom: 1rem; margin-bottom: 1.5rem; }
9
+ h1 { font-size: 1.4rem; }
10
+ .classification { background: #991b1b; color: #fecaca; padding: 0.3rem 0.8rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
11
+ .user-info { color: #64748b; font-size: 0.85rem; }
12
+ .grid { display: grid; grid-template-columns: 250px 1fr; gap: 1.5rem; }
13
+ .sidebar { display: flex; flex-direction: column; gap: 0.5rem; }
14
+ .nav-item { padding: 0.6rem 0.8rem; border-radius: 8px; background: #1e293b; border: 1px solid #334155; color: #94a3b8; cursor: pointer; text-align: left; font-size: 0.9rem; }
15
+ .nav-item.active { background: #1e3a5f; border-color: #3b82f6; color: #e2e8f0; }
16
+ .content { border: 1px solid #1e293b; border-radius: 12px; background: #111827; padding: 1.5rem; }
17
+ .content h2 { margin-bottom: 1rem; font-size: 1.2rem; }
18
+ table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
19
+ th { text-align: left; padding: 0.6rem; color: #64748b; border-bottom: 1px solid #1e293b; font-weight: 600; }
20
+ td { padding: 0.6rem; border-bottom: 1px solid #0f172a; }
21
+ .status-active { color: #34d399; }
22
+ .status-suspended { color: #f87171; }
23
+ .status-pending { color: #fbbf24; }
24
+ .actions { display: flex; gap: 0.4rem; }
25
+ .actions button { padding: 0.3rem 0.6rem; border-radius: 6px; border: none; font-size: 0.8rem; cursor: pointer; }
26
+ .btn-view { background: #1e3a5f; color: #93c5fd; }
27
+ .btn-suspend { background: #7f1d1d; color: #fca5a5; }
28
+ .btn-delete { background: #991b1b; color: #fecaca; }
29
+ .btn-approve { background: #14532d; color: #86efac; }
30
+ .audit-log { margin-top: 1rem; font-family: monospace; font-size: 0.8rem; background: #0a0e17; border: 1px solid #1e293b; border-radius: 8px; padding: 0.8rem; max-height: 200px; overflow-y: auto; }
31
+ .audit-entry { padding: 0.2rem 0; color: #64748b; }
32
+ .audit-entry .timestamp { color: #475569; }
33
+ .audit-entry .action { color: #fbbf24; }
34
+ .modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; align-items: center; justify-content: center; }
35
+ .modal.visible { display: flex; }
36
+ .modal-content { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 1.5rem; max-width: 400px; text-align: center; }
37
+ .modal-content h3 { color: #f87171; margin-bottom: 0.8rem; }
38
+ .modal-content p { color: #94a3b8; margin-bottom: 1rem; }
39
+ .modal-actions { display: flex; gap: 0.8rem; justify-content: center; }
40
+ .modal-actions button { padding: 0.5rem 1.2rem; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; }
41
+ .btn-cancel { background: #334155; color: #e2e8f0; }
42
+ .btn-confirm-delete { background: #991b1b; color: white; }
43
+ </style>
44
+ </head>
45
+ <body>
46
+ <div class="header">
47
+ <div>
48
+ <h1>System Administration</h1>
49
+ <span class="user-info">Operator: admin@agency.gov · Session: 4f8a2c · Clearance: TS/SCI</span>
50
+ </div>
51
+ <span class="classification">TOP SECRET // SCI</span>
52
+ </div>
53
+ <div class="grid">
54
+ <div class="sidebar">
55
+ <button class="nav-item active" id="nav-users">User Management</button>
56
+ <button class="nav-item" id="nav-access">Access Control</button>
57
+ <button class="nav-item" id="nav-audit">Audit Trail</button>
58
+ <button class="nav-item" id="nav-system">System Config</button>
59
+ </div>
60
+ <div class="content">
61
+ <h2>User Management</h2>
62
+ <table>
63
+ <thead>
64
+ <tr><th>Name</th><th>Role</th><th>Clearance</th><th>Status</th><th>Actions</th></tr>
65
+ </thead>
66
+ <tbody>
67
+ <tr>
68
+ <td>Col. Sarah Chen</td><td>Program Director</td><td>TS/SCI</td>
69
+ <td class="status-active">Active</td>
70
+ <td class="actions"><button class="btn-view">View</button><button class="btn-suspend">Suspend</button></td>
71
+ </tr>
72
+ <tr>
73
+ <td>Maj. James Rivera</td><td>Systems Engineer</td><td>TS</td>
74
+ <td class="status-active">Active</td>
75
+ <td class="actions"><button class="btn-view">View</button><button class="btn-suspend">Suspend</button></td>
76
+ </tr>
77
+ <tr>
78
+ <td>Dr. Aisha Patel</td><td>Analyst</td><td>Secret</td>
79
+ <td class="status-pending">Pending Review</td>
80
+ <td class="actions"><button class="btn-view">View</button><button class="btn-approve">Approve</button></td>
81
+ </tr>
82
+ <tr>
83
+ <td>Lt. Marcus Webb</td><td>Contractor</td><td>Secret</td>
84
+ <td class="status-suspended">Suspended</td>
85
+ <td class="actions"><button class="btn-view">View</button><button class="btn-delete" id="delete-webb">Delete</button></td>
86
+ </tr>
87
+ </tbody>
88
+ </table>
89
+ <div class="audit-log" id="audit-log">
90
+ <div class="audit-entry"><span class="timestamp">2026-04-10T09:14:22Z</span> <span class="action">LOGIN</span> admin@agency.gov from 10.0.0.42</div>
91
+ <div class="audit-entry"><span class="timestamp">2026-04-10T09:14:28Z</span> <span class="action">VIEW</span> User Management panel accessed</div>
92
+ </div>
93
+ </div>
94
+ </div>
95
+ <div id="delete-modal" class="modal">
96
+ <div class="modal-content">
97
+ <h3>Confirm User Deletion</h3>
98
+ <p>This action is irreversible. Lt. Marcus Webb's access credentials, audit history, and associated records will be permanently removed.</p>
99
+ <div class="modal-actions">
100
+ <button class="btn-cancel" id="cancel-delete">Cancel</button>
101
+ <button class="btn-confirm-delete" id="confirm-delete">Delete User</button>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ <script>
106
+ var auditLog = document.getElementById('audit-log');
107
+ function logAudit(action, detail) {
108
+ var entry = document.createElement('div');
109
+ entry.className = 'audit-entry';
110
+ entry.innerHTML = '<span class="timestamp">' + new Date().toISOString() + '</span> <span class="action">' + action + '</span> ' + detail;
111
+ auditLog.appendChild(entry);
112
+ auditLog.scrollTop = auditLog.scrollHeight;
113
+ }
114
+ document.getElementById('delete-webb').addEventListener('click', function() {
115
+ document.getElementById('delete-modal').classList.add('visible');
116
+ logAudit('DELETE_REQUESTED', 'Deletion requested for Lt. Marcus Webb');
117
+ });
118
+ document.getElementById('cancel-delete').addEventListener('click', function() {
119
+ document.getElementById('delete-modal').classList.remove('visible');
120
+ logAudit('DELETE_CANCELLED', 'Deletion cancelled for Lt. Marcus Webb');
121
+ });
122
+ document.getElementById('confirm-delete').addEventListener('click', function() {
123
+ document.getElementById('delete-modal').classList.remove('visible');
124
+ logAudit('DELETE_CONFIRMED', 'Lt. Marcus Webb permanently deleted');
125
+ });
126
+ </script>
127
+ </body>
128
+ </html>
@@ -0,0 +1,237 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Agent Oversight — Autonomous System Monitor</title>
5
+ <style>
6
+ * { box-sizing: border-box; margin: 0; padding: 0; }
7
+ body { font-family: 'SF Mono', 'Fira Code', monospace; background: #080c14; color: #c8d6e5; min-height: 100vh; padding: 1rem; font-size: 0.85rem; }
8
+ .header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #1a2744; padding-bottom: 0.8rem; margin-bottom: 1rem; }
9
+ h1 { font-size: 1.1rem; color: #e2e8f0; }
10
+ .system-status { display: flex; gap: 1.5rem; font-size: 0.75rem; color: #5a7a9e; }
11
+ .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
12
+ .panel { background: #0d1525; border: 1px solid #1a2744; border-radius: 8px; padding: 1rem; }
13
+ .panel h2 { font-size: 0.85rem; color: #7eb8da; margin-bottom: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
14
+ .agent-card { background: #111d30; border: 1px solid #1a2744; border-radius: 6px; padding: 0.8rem; margin-bottom: 0.6rem; }
15
+ .agent-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
16
+ .agent-name { color: #e2e8f0; font-weight: 600; }
17
+ .agent-status { padding: 0.1rem 0.5rem; border-radius: 3px; font-size: 0.7rem; }
18
+ .status-running { background: #001a0a; color: #00cc66; border: 1px solid #00cc66; }
19
+ .status-flagged { background: #1a1400; color: #ffd700; border: 1px solid #ffd700; animation: pulse 2s ease-in-out infinite; }
20
+ @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
21
+ .status-halted { background: #1a0808; color: #ff4444; border: 1px solid #ff4444; }
22
+ .agent-detail { color: #5a7a9e; font-size: 0.75rem; line-height: 1.5; }
23
+ .agent-actions { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
24
+ button { padding: 0.3rem 0.6rem; border-radius: 4px; border: 1px solid #1a2744; background: #111d30; color: #7eb8da; cursor: pointer; font: inherit; font-size: 0.75rem; }
25
+ .btn-review { border-color: #00bfff; color: #00bfff; }
26
+ .btn-halt { border-color: #ff4444; color: #ff4444; }
27
+ .btn-approve { border-color: #00cc66; color: #00cc66; }
28
+ .btn-rollback { border-color: #ff8c00; color: #ff8c00; }
29
+ .policy-row { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid #111d30; }
30
+ .policy-pass { color: #00cc66; }
31
+ .policy-flag { color: #ffd700; }
32
+ .policy-block { color: #ff4444; }
33
+ .audit-entry { padding: 0.3rem 0; border-bottom: 1px solid #111d30; display: flex; gap: 0.6rem; font-size: 0.75rem; }
34
+ .audit-ts { color: #3a5570; min-width: 75px; }
35
+ .audit-agent { color: #7eb8da; min-width: 90px; }
36
+ .full-width { grid-column: 1 / -1; }
37
+ .metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
38
+ .metric { background: #111d30; border: 1px solid #1a2744; border-radius: 6px; padding: 0.8rem; text-align: center; }
39
+ .metric-value { font-size: 1.4rem; font-weight: 700; color: #7eb8da; }
40
+ .metric-label { font-size: 0.7rem; color: #5a7a9e; margin-top: 0.2rem; }
41
+ .metric-value.critical { color: #ff4444; }
42
+ .metric-value.warning { color: #ffd700; }
43
+ .metric-value.good { color: #00cc66; }
44
+ .modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 100; align-items: center; justify-content: center; }
45
+ .modal.visible { display: flex; }
46
+ .modal-content { background: #0d1525; border: 1px solid #ff4444; border-radius: 8px; padding: 1.5rem; max-width: 460px; }
47
+ .modal-content h3 { color: #ff4444; margin-bottom: 0.6rem; }
48
+ .modal-content p { color: #7eb8da; margin-bottom: 1rem; line-height: 1.6; }
49
+ .modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }
50
+ .response-banner { display: none; padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-weight: 600; }
51
+ .response-banner.visible { display: block; }
52
+ </style>
53
+ </head>
54
+ <body>
55
+ <div class="header">
56
+ <div>
57
+ <h1>Agent Oversight Dashboard</h1>
58
+ <div class="system-status">
59
+ <span>Agents active: 4</span>
60
+ <span>Policy violations today: 2</span>
61
+ <span>Human reviews pending: 1</span>
62
+ <span>Uptime: 99.97%</span>
63
+ </div>
64
+ </div>
65
+ </div>
66
+
67
+ <div id="response-banner" class="response-banner"></div>
68
+
69
+ <div class="metric-grid">
70
+ <div class="metric"><div class="metric-value good">847</div><div class="metric-label">Tasks completed</div></div>
71
+ <div class="metric"><div class="metric-value">12.4ms</div><div class="metric-label">Avg step latency</div></div>
72
+ <div class="metric"><div class="metric-value warning">2</div><div class="metric-label">Policy violations</div></div>
73
+ <div class="metric"><div class="metric-value critical">1</div><div class="metric-label">Pending review</div></div>
74
+ </div>
75
+
76
+ <div class="grid">
77
+ <div class="panel">
78
+ <h2>Active Agents</h2>
79
+ <div class="agent-card">
80
+ <div class="agent-header">
81
+ <span class="agent-name">deploy-agent-prod</span>
82
+ <span class="agent-status status-flagged">FLAGGED — REVIEW REQUIRED</span>
83
+ </div>
84
+ <div class="agent-detail">
85
+ Task: Deploy v2.4.1 to production cluster<br>
86
+ Last action: Attempted to modify production database schema<br>
87
+ Policy: write-high BLOCKED — requires human approval
88
+ </div>
89
+ <div class="agent-actions">
90
+ <button class="btn-review" id="review-deploy">Review Actions</button>
91
+ <button class="btn-approve" id="approve-deploy">Approve &amp; Continue</button>
92
+ <button class="btn-halt" id="halt-deploy">Halt Agent</button>
93
+ </div>
94
+ </div>
95
+ <div class="agent-card">
96
+ <div class="agent-header">
97
+ <span class="agent-name">test-runner-ci</span>
98
+ <span class="agent-status status-running">RUNNING</span>
99
+ </div>
100
+ <div class="agent-detail">
101
+ Task: E2E regression suite — 142/200 tests complete<br>
102
+ Last action: Assert dashboard loads in &lt; 2s<br>
103
+ Policy: controlled-web — no violations
104
+ </div>
105
+ <div class="agent-actions">
106
+ <button class="btn-review" id="review-test">Review Actions</button>
107
+ <button class="btn-halt" id="halt-test">Halt Agent</button>
108
+ </div>
109
+ </div>
110
+ <div class="agent-card">
111
+ <div class="agent-header">
112
+ <span class="agent-name">security-scanner</span>
113
+ <span class="agent-status status-running">RUNNING</span>
114
+ </div>
115
+ <div class="agent-detail">
116
+ Task: Penetration test — internal web apps<br>
117
+ Last action: SQL injection test on /api/users<br>
118
+ Policy: open-web — authorized pentest
119
+ </div>
120
+ <div class="agent-actions">
121
+ <button class="btn-review" id="review-scanner">Review Actions</button>
122
+ <button class="btn-halt" id="halt-scanner">Halt Agent</button>
123
+ </div>
124
+ </div>
125
+ <div class="agent-card">
126
+ <div class="agent-header">
127
+ <span class="agent-name">data-migration-agent</span>
128
+ <span class="agent-status status-halted">HALTED — KILL SWITCH</span>
129
+ </div>
130
+ <div class="agent-detail">
131
+ Task: Migrate user records from legacy DB<br>
132
+ Last action: DELETE FROM users WHERE created_at &lt; 2024<br>
133
+ Policy: write-high BLOCKED — kill switch activated by admin
134
+ </div>
135
+ <div class="agent-actions">
136
+ <button class="btn-rollback" id="rollback-migration">Rollback Changes</button>
137
+ </div>
138
+ </div>
139
+ </div>
140
+
141
+ <div class="panel">
142
+ <h2>EA1 Policy Decisions (last 24h)</h2>
143
+ <div class="policy-row"><span>Read operations</span><span class="policy-pass">ALLOW — 2,847</span></div>
144
+ <div class="policy-row"><span>Write-low (form input, drafts)</span><span class="policy-pass">ALLOW — 412</span></div>
145
+ <div class="policy-row"><span>Write-high (delete, transfer, deploy)</span><span class="policy-block">BLOCK — 23</span></div>
146
+ <div class="policy-row"><span>Sensitive input (credentials)</span><span class="policy-block">BLOCK — 8</span></div>
147
+ <div class="policy-row"><span>Kill switch activations</span><span class="policy-flag">1</span></div>
148
+ <div class="policy-row"><span>Human approvals granted</span><span class="policy-pass">ALLOW — 4</span></div>
149
+ <div class="policy-row"><span>Human approvals denied</span><span class="policy-block">DENY — 1</span></div>
150
+ </div>
151
+
152
+ <div class="panel full-width">
153
+ <h2>Audit Trail</h2>
154
+ <div id="audit-feed">
155
+ <div class="audit-entry"><span class="audit-ts">09:44:12</span><span class="audit-agent">deploy-agent</span><span class="policy-block">BLOCK</span> Attempted ALTER TABLE users — write-high denied, pending human review</div>
156
+ <div class="audit-entry"><span class="audit-ts">09:43:58</span><span class="audit-agent">test-runner</span><span class="policy-pass">ALLOW</span> Assert response time &lt; 2000ms on /dashboard — passed</div>
157
+ <div class="audit-entry"><span class="audit-ts">09:41:22</span><span class="audit-agent">data-migration</span><span class="policy-block">KILL SWITCH</span> DELETE FROM users — kill switch activated by admin@company.com</div>
158
+ <div class="audit-entry"><span class="audit-ts">09:40:15</span><span class="audit-agent">security-scan</span><span class="policy-pass">ALLOW</span> SQL injection test: ' OR 1=1 -- on /api/users (authorized pentest)</div>
159
+ <div class="audit-entry"><span class="audit-ts">09:38:44</span><span class="audit-agent">deploy-agent</span><span class="policy-pass">ALLOW</span> Read deployment manifest v2.4.1 — classification: read</div>
160
+ <div class="audit-entry"><span class="audit-ts">09:35:02</span><span class="audit-agent">test-runner</span><span class="policy-pass">ALLOW</span> Navigate to http://localhost:3000/login — classification: read</div>
161
+ </div>
162
+ </div>
163
+ </div>
164
+
165
+ <div id="halt-modal" class="modal">
166
+ <div class="modal-content">
167
+ <h3>Confirm Agent Halt</h3>
168
+ <p id="halt-modal-text">This will immediately activate the kill switch for this agent. All queued actions will be cancelled. The agent's audit trail will be preserved for review.</p>
169
+ <div class="modal-actions">
170
+ <button class="btn-cancel" id="cancel-halt">Cancel</button>
171
+ <button class="btn-halt" id="confirm-halt" style="font-weight:700">Halt Agent</button>
172
+ </div>
173
+ </div>
174
+ </div>
175
+
176
+ <script>
177
+ var haltTarget = '';
178
+ function addAudit(agent, level, msg) {
179
+ var feed = document.getElementById('audit-feed');
180
+ var entry = document.createElement('div');
181
+ entry.className = 'audit-entry';
182
+ var now = new Date();
183
+ var ts = now.toTimeString().slice(0, 8);
184
+ var cls = level === 'BLOCK' ? 'policy-block' : level === 'KILL SWITCH' ? 'policy-block' : level === 'FLAG' ? 'policy-flag' : 'policy-pass';
185
+ entry.innerHTML = '<span class="audit-ts">' + ts + '</span><span class="audit-agent">' + agent + '</span><span class="' + cls + '">' + level + '</span> ' + msg;
186
+ feed.insertBefore(entry, feed.firstChild);
187
+ }
188
+
189
+ document.getElementById('approve-deploy').addEventListener('click', function() {
190
+ var banner = document.getElementById('response-banner');
191
+ banner.className = 'response-banner visible';
192
+ banner.style.background = '#001a0a';
193
+ banner.style.border = '1px solid #00cc66';
194
+ banner.style.color = '#00cc66';
195
+ banner.textContent = 'deploy-agent-prod approved. Schema migration proceeding under supervision.';
196
+ addAudit('deploy-agent', 'ALLOW', 'Human approval granted for ALTER TABLE users by operator');
197
+ });
198
+ document.getElementById('halt-deploy').addEventListener('click', function() {
199
+ haltTarget = 'deploy-agent-prod';
200
+ document.getElementById('halt-modal-text').textContent = 'This will immediately activate the kill switch for deploy-agent-prod. The pending schema migration will be cancelled. All actions are logged.';
201
+ document.getElementById('halt-modal').classList.add('visible');
202
+ });
203
+ document.getElementById('halt-test').addEventListener('click', function() {
204
+ haltTarget = 'test-runner-ci';
205
+ document.getElementById('halt-modal-text').textContent = 'This will halt test-runner-ci at test 142/200. Partial results will be preserved. The agent can be resumed later.';
206
+ document.getElementById('halt-modal').classList.add('visible');
207
+ });
208
+ document.getElementById('halt-scanner').addEventListener('click', function() {
209
+ haltTarget = 'security-scanner';
210
+ document.getElementById('halt-modal-text').textContent = 'This will halt the authorized penetration test. All findings so far will be preserved in the audit trail.';
211
+ document.getElementById('halt-modal').classList.add('visible');
212
+ });
213
+ document.getElementById('rollback-migration').addEventListener('click', function() {
214
+ var banner = document.getElementById('response-banner');
215
+ banner.className = 'response-banner visible';
216
+ banner.style.background = '#1a1400';
217
+ banner.style.border = '1px solid #ffd700';
218
+ banner.style.color = '#ffd700';
219
+ banner.textContent = 'Rollback initiated for data-migration-agent. Restoring from last checkpoint...';
220
+ addAudit('data-migration', 'FLAG', 'Rollback initiated by operator — restoring user records from checkpoint');
221
+ });
222
+ document.getElementById('cancel-halt').addEventListener('click', function() {
223
+ document.getElementById('halt-modal').classList.remove('visible');
224
+ });
225
+ document.getElementById('confirm-halt').addEventListener('click', function() {
226
+ document.getElementById('halt-modal').classList.remove('visible');
227
+ var banner = document.getElementById('response-banner');
228
+ banner.className = 'response-banner visible';
229
+ banner.style.background = '#1a0808';
230
+ banner.style.border = '1px solid #ff4444';
231
+ banner.style.color = '#ff4444';
232
+ banner.textContent = haltTarget + ' — KILL SWITCH ACTIVATED. All actions halted.';
233
+ addAudit(haltTarget, 'KILL SWITCH', 'Kill switch activated by operator — all actions halted');
234
+ });
235
+ </script>
236
+ </body>
237
+ </html>