opena2a-cli 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -603
- package/dist/adapters/docker.d.ts.map +1 -1
- package/dist/adapters/docker.js +5 -2
- package/dist/adapters/docker.js.map +1 -1
- package/dist/adapters/registry.d.ts.map +1 -1
- package/dist/adapters/registry.js +1 -0
- package/dist/adapters/registry.js.map +1 -1
- package/dist/adapters/types.d.ts +2 -0
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/commands/create/index.d.ts +21 -0
- package/dist/commands/create/index.d.ts.map +1 -0
- package/dist/commands/create/index.js +44 -0
- package/dist/commands/create/index.js.map +1 -0
- package/dist/commands/create/skill.d.ts +35 -0
- package/dist/commands/create/skill.d.ts.map +1 -0
- package/dist/commands/create/skill.js +250 -0
- package/dist/commands/create/skill.js.map +1 -0
- package/dist/commands/create/templates.d.ts +47 -0
- package/dist/commands/create/templates.d.ts.map +1 -0
- package/dist/commands/create/templates.js +392 -0
- package/dist/commands/create/templates.js.map +1 -0
- package/dist/commands/detect.js +1 -1
- package/dist/commands/detect.js.map +1 -1
- package/dist/commands/guard-harden.d.ts +15 -0
- package/dist/commands/guard-harden.d.ts.map +1 -0
- package/dist/commands/guard-harden.js +242 -0
- package/dist/commands/guard-harden.js.map +1 -0
- package/dist/commands/guard.d.ts +3 -1
- package/dist/commands/guard.d.ts.map +1 -1
- package/dist/commands/guard.js +25 -1
- package/dist/commands/guard.js.map +1 -1
- package/dist/commands/identity.d.ts +5 -0
- package/dist/commands/identity.d.ts.map +1 -1
- package/dist/commands/identity.js +515 -11
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/login.d.ts +24 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +238 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/mcp-audit.d.ts.map +1 -1
- package/dist/commands/mcp-audit.js +4 -0
- package/dist/commands/mcp-audit.js.map +1 -1
- package/dist/index.js +124 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/registry-client.d.ts +59 -0
- package/dist/lib/registry-client.d.ts.map +1 -0
- package/dist/lib/registry-client.js +169 -0
- package/dist/lib/registry-client.js.map +1 -0
- package/dist/semantic/command-index.json +27 -0
- package/dist/shield/status.d.ts.map +1 -1
- package/dist/shield/status.js +22 -1
- package/dist/shield/status.js.map +1 -1
- package/dist/util/aim-client.d.ts +141 -0
- package/dist/util/aim-client.d.ts.map +1 -0
- package/dist/util/aim-client.js +225 -0
- package/dist/util/aim-client.js.map +1 -0
- package/dist/util/auth.d.ts +23 -0
- package/dist/util/auth.d.ts.map +1 -0
- package/dist/util/auth.js +54 -0
- package/dist/util/auth.js.map +1 -0
- package/dist/util/server-url.d.ts +15 -0
- package/dist/util/server-url.d.ts.map +1 -0
- package/dist/util/server-url.js +42 -0
- package/dist/util/server-url.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,640 +1,92 @@
|
|
|
1
|
-
|
|
1
|
+
> **[OpenA2A](https://github.com/opena2a-org/opena2a)**: [CLI](https://github.com/opena2a-org/opena2a) · [HackMyAgent](https://github.com/opena2a-org/hackmyagent) · [Secretless](https://github.com/opena2a-org/secretless-ai) · [AIM](https://github.com/opena2a-org/agent-identity-management) · [Browser Guard](https://github.com/opena2a-org/AI-BrowserGuard) · [DVAA](https://github.com/opena2a-org/damn-vulnerable-ai-agent) · Registry (April 2026)
|
|
2
2
|
|
|
3
|
-
# opena2a
|
|
3
|
+
# opena2a
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Credential detection, scope drift analysis, config integrity, runtime monitoring, behavioral governance scanning, and supply chain verification -- one CLI.
|
|
8
|
-
|
|
9
|
-
**Get a full security review in one command:**
|
|
5
|
+
Open-source security platform for AI agents. Installed as `opena2a-cli` on npm.
|
|
10
6
|
|
|
11
7
|
```bash
|
|
12
8
|
npx opena2a-cli review
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
[](https://github.com/opena2a-org/opena2a/blob/main/LICENSE)
|
|
16
|
-
[]()
|
|
17
|
-
[](https://www.npmjs.com/package/opena2a-cli)
|
|
18
|
-
|
|
19
|
-
[Website](https://opena2a.org) | [Docs](https://opena2a.org/docs) | [Discord](https://discord.gg/uRZa3KXgEn) | [GitHub](https://github.com/opena2a-org/opena2a)
|
|
20
|
-
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Install
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# Try without installing
|
|
29
|
-
npx opena2a-cli init
|
|
30
|
-
|
|
31
|
-
# Install globally
|
|
32
|
-
npm install -g opena2a-cli
|
|
33
|
-
|
|
34
|
-
# Homebrew (macOS/Linux)
|
|
35
|
-
brew tap opena2a-org/tap && brew install opena2a
|
|
36
11
|
```
|
|
12
|
+
OpenA2A Security Review v0.7.2
|
|
37
13
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## What It Does
|
|
41
|
-
|
|
42
|
-
Run `opena2a init` in any project directory to get a read-only security assessment:
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
OpenA2A Security Report v0.5.7
|
|
46
|
-
|
|
47
|
-
Project myapp v2.1.0
|
|
48
|
-
Type Node.js + MCP server
|
|
49
|
-
Directory /home/user/myapp
|
|
50
|
-
|
|
51
|
-
Security Posture
|
|
14
|
+
Findings
|
|
52
15
|
-----------------------------------------------
|
|
53
|
-
Credential scan
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Security config none
|
|
58
|
-
MCP config found
|
|
59
|
-
LLM server Ollama on :11434 (no auth)
|
|
16
|
+
Credential scan 3 hardcoded keys
|
|
17
|
+
Shadow AI 2 agents, 4 MCP servers
|
|
18
|
+
Config integrity unsigned
|
|
19
|
+
Governance no SOUL.md
|
|
60
20
|
-----------------------------------------------
|
|
61
21
|
Security Score 30 / 100 -> 85 by running opena2a protect
|
|
62
22
|
|
|
63
|
-
|
|
64
|
-
-----------------------------------------------
|
|
65
|
-
[CRITICAL] Migrate 3 hardcoded credentials
|
|
66
|
-
opena2a protect
|
|
67
|
-
|
|
68
|
-
[HIGH] Add .env to .gitignore
|
|
69
|
-
opena2a protect
|
|
70
|
-
|
|
71
|
-
[MEDIUM] Sign config files for integrity
|
|
72
|
-
opena2a protect
|
|
73
|
-
-----------------------------------------------
|
|
74
|
-
|
|
75
|
-
Scope Drift Detected
|
|
76
|
-
-----------------------------------------------
|
|
77
|
-
DRIFT-001 Google Maps key may access Gemini AI
|
|
78
|
-
src/config.js:5
|
|
79
|
-
|
|
80
|
-
Scope drift: keys provisioned for one service silently
|
|
81
|
-
gain access to AI services, expanding attack surface.
|
|
82
|
-
Run: opena2a protect
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Then fix everything in one command:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
opena2a protect # Fix all findings: credentials, .gitignore, config signing
|
|
89
|
-
opena2a init # Re-assess -- watch your score improve
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Scope Drift Detection
|
|
93
|
-
|
|
94
|
-
API keys provisioned for one service often silently grant access to others. A Google Maps key can call Gemini. An AWS S3 key may reach Bedrock.
|
|
95
|
-
|
|
96
|
-
OpenA2A detects these cross-service privilege escalations:
|
|
97
|
-
|
|
98
|
-
| Finding | What It Means |
|
|
99
|
-
|---------|---------------|
|
|
100
|
-
| **DRIFT-001** | Google API key can access Gemini AI models beyond intended Maps/Places scope |
|
|
101
|
-
| **DRIFT-002** | AWS access key can invoke Bedrock LLM models beyond intended S3/EC2 scope |
|
|
102
|
-
|
|
103
|
-
When drift is detected, `opena2a protect` migrates the key to environment variables and creates a deny-all broker policy so you can explicitly control which services each key is allowed to reach.
|
|
104
|
-
|
|
105
|
-
## Core Commands
|
|
106
|
-
|
|
107
|
-
### `opena2a review`
|
|
108
|
-
|
|
109
|
-
Run all security checks and generate a unified HTML dashboard. This is the recommended starting point -- it combines credential scanning, config integrity, Shield posture, shadow AI detection, advisory checks, and optional HMA deep scan into a single interactive report with 6 tabs.
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
opena2a review # Scan + open HTML report in browser
|
|
113
|
-
opena2a review --no-open # Generate report without opening
|
|
114
|
-
opena2a review --report out.html # Save to custom path
|
|
115
|
-
opena2a review --format json # JSON output for CI
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### `opena2a detect`
|
|
119
|
-
|
|
120
|
-
Discover AI agents, MCP servers, and AI configurations running on this machine. Reports a governance score (0-100, where 100 = fully governed) with actionable findings that explain why each issue matters and how to fix it.
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
opena2a detect # Scan current project
|
|
124
|
-
opena2a detect --report # Generate HTML executive report
|
|
125
|
-
opena2a detect --export-csv assets.csv # Export asset inventory for CMDB
|
|
126
|
-
opena2a detect --format json # Machine-readable output
|
|
127
|
-
opena2a detect --verbose # Show full MCP server list and PIDs
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
What detect finds:
|
|
131
|
-
- **Running AI agents**: Claude Code, Cursor, GitHub Copilot, Windsurf, Aider, Ollama, LM Studio, and more
|
|
132
|
-
- **MCP servers**: Project-local and machine-wide configurations across Claude, Cursor, Windsurf, Cline, and VS Code
|
|
133
|
-
- **AI config files**: `.cursorrules`, `CLAUDE.md`, `.copilot`, `.windsurfrules`, and framework configs
|
|
134
|
-
- **Governance posture**: AIM identity, SOUL.md behavioral rules, capability policies
|
|
135
|
-
|
|
136
|
-
The CSV export includes hostname, username, scan directory, and timestamp on every row for enterprise CMDB import.
|
|
137
|
-
|
|
138
|
-
### `opena2a init`
|
|
139
|
-
|
|
140
|
-
Read-only security assessment. Detects project type (Node.js, Python via `pyproject.toml`, Go via `go.mod`), scans for credentials, checks hygiene (`.gitignore`, `.env` protection, lock file, security config, `.mcp/config.json`), calculates a trust score (0-100), and provides prioritized next steps. Does not modify any files -- use `opena2a protect` or `opena2a shield init` to take action.
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
opena2a init # Assess current directory
|
|
144
|
-
opena2a init --dir ./my-agent # Assess specific directory
|
|
145
|
-
opena2a init --verbose # Show individual credential details
|
|
146
|
-
opena2a init --format json # Machine-readable output for CI
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
For a full security orchestration (credential scanning, policy generation, shell hooks, event log), use `opena2a shield init` instead.
|
|
150
|
-
|
|
151
|
-
### `opena2a protect`
|
|
152
|
-
|
|
153
|
-
Single command to fix all auto-fixable findings. Migrates credentials, fixes `.gitignore`, excludes AI config files from git, signs config files, and shows before/after security score.
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
opena2a protect # Fix everything fixable
|
|
157
|
-
opena2a protect --dry-run # Preview changes without modifying files
|
|
158
|
-
opena2a protect --skip-sign # Skip config signing phase
|
|
159
|
-
opena2a protect --skip-git # Skip git hygiene fixes
|
|
160
|
-
opena2a protect --report out.html # Generate interactive HTML report
|
|
161
|
-
opena2a protect --format json # JSON output for CI pipelines
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
What protect fixes:
|
|
165
|
-
1. **Credentials** -- Detect, vault, and replace hardcoded secrets with env var references
|
|
166
|
-
2. **`.gitignore`** -- Create or update to exclude `.env` files
|
|
167
|
-
3. **AI config exclusion** -- Add `CLAUDE.md`, `.cursorrules`, etc. to `.git/info/exclude`
|
|
168
|
-
4. **Config signing** -- Sign config files for tamper detection
|
|
169
|
-
5. **Verification** -- Re-scan and show before/after security score
|
|
170
|
-
|
|
171
|
-
### `opena2a guard`
|
|
172
|
-
|
|
173
|
-
Config file integrity protection. Sign your config files and detect unauthorized modifications.
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
opena2a guard sign # Sign all detected config files (SHA-256)
|
|
177
|
-
opena2a guard verify # Check for tampering or unsigned files
|
|
178
|
-
opena2a guard status # Show signature summary
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
Default files: `mcp.json`, `package.json`, `tsconfig.json`, `arp.yaml`, `go.mod`, `Dockerfile`, and more.
|
|
182
|
-
|
|
183
|
-
### `opena2a runtime`
|
|
184
|
-
|
|
185
|
-
Agent Runtime Protection (ARP) wrapper. Monitor process, network, and filesystem activity.
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
opena2a runtime init # Generate arp.yaml for your project
|
|
189
|
-
opena2a runtime start # Start monitoring
|
|
190
|
-
opena2a runtime status # Show monitor/interceptor status
|
|
191
|
-
opena2a runtime tail # View recent security events
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### `opena2a verify`
|
|
195
|
-
|
|
196
|
-
Binary integrity verification. Compares installed package hashes against the OpenA2A Trust Registry to detect supply chain tampering.
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
opena2a verify # Check all OpenA2A packages
|
|
200
|
-
opena2a verify --package hackmyagent # Check specific package
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### `opena2a self-register`
|
|
204
|
-
|
|
205
|
-
Register OpenA2A tools in the public Trust Registry with security scan results.
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
opena2a self-register --dry-run # Preview what would be registered
|
|
209
|
-
opena2a self-register # Register all 13 tools
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### `opena2a config`
|
|
213
|
-
|
|
214
|
-
Manage user preferences and feature toggles.
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
opena2a config show # Display current configuration
|
|
218
|
-
opena2a config contribute on # Enable community data sharing
|
|
219
|
-
opena2a config llm on # Enable LLM-powered command matching
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### `opena2a trust`
|
|
223
|
-
|
|
224
|
-
Look up the trust profile for an AI agent or MCP server from the OpenA2A Trust Registry (Agent Trust Protocol).
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
opena2a trust express # Look up npm package
|
|
228
|
-
opena2a trust langchain --source pypi # Look up PyPI package
|
|
229
|
-
opena2a trust https://github.com/org/repo # GitHub URL (auto-parsed)
|
|
230
|
-
opena2a trust # Auto-detect from package.json in cwd
|
|
231
|
-
opena2a trust express --json # Machine-readable output
|
|
232
|
-
opena2a trust express --verbose # Show full posture details
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
Defaults to npm as the source when `--source` is not specified. Supports `npm`, `pypi`, and `github` sources.
|
|
236
|
-
|
|
237
|
-
### `opena2a claim`
|
|
238
|
-
|
|
239
|
-
Claim ownership of a discovered agent in the Trust Registry. Verifies ownership via npm or GitHub, generates an Ed25519 keypair at `~/.opena2a/keys/`, and links the profile to your verified identity.
|
|
240
|
-
|
|
241
|
-
```bash
|
|
242
|
-
opena2a claim my-agent # Claim via npm ownership verification
|
|
243
|
-
opena2a claim # Auto-detect from package.json in cwd
|
|
244
|
-
opena2a claim my-agent --json # Machine-readable output
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
## Shield: Unified Security Orchestration
|
|
248
|
-
|
|
249
|
-
Shield ties all OpenA2A tools into a single security layer for AI coding assistants. It provides a tamper-evident event log, policy evaluation, runtime monitoring, session identification, integrity verification, and LLM-powered analysis.
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
opena2a shield init # Full environment scan + policy generation
|
|
253
|
-
opena2a shield status # Tool availability and integrity state
|
|
254
|
-
opena2a shield selfcheck # Run integrity checks across all subsystems
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### How Shield protects your workstation
|
|
258
|
-
|
|
259
|
-
| Capability | What it does | Status |
|
|
260
|
-
|-----------|-------------|--------|
|
|
261
|
-
| **Credential scanning** | Detects hardcoded API keys (Anthropic, OpenAI, AWS, Google, GitHub) | Active |
|
|
262
|
-
| **Scope drift detection** | Finds API keys that silently access unintended services (DRIFT-001, DRIFT-002) | Active |
|
|
263
|
-
| **Tamper-evident event log** | SHA-256 hash-chained event log -- any modification breaks the chain | Active |
|
|
264
|
-
| **Policy evaluation** | Allow/deny rules for processes, credentials, network, filesystem, MCP servers | Active |
|
|
265
|
-
| **Session identification** | Detects which AI assistant is running (Claude Code, Cursor, Copilot, Windsurf) | Active |
|
|
266
|
-
| **Config integrity** | Signs config files and detects unauthorized modifications | Active |
|
|
267
|
-
| **ARP bridge** | Imports runtime protection events from HackMyAgent's ARP into Shield's log | Active |
|
|
268
|
-
| **Posture scoring** | 0-100 security score based on active tools, policy, hooks, credentials | Active |
|
|
269
|
-
| **LLM intelligence** | AI-powered policy suggestions, anomaly explanations, incident triage | Active (opt-in) |
|
|
270
|
-
| **Integrity selfcheck** | Verifies policy, shell hooks, event chain, process, and artifact signatures | Active |
|
|
271
|
-
| **Lockdown mode** | Enters lockdown when integrity checks fail; requires explicit recovery | Active |
|
|
272
|
-
| **Adaptive baselines** | Learns per-agent behavior, tracks stability across sessions, suggests policies | Active |
|
|
273
|
-
| **Enforcement mode** | Shell hooks check policy in enforce mode and block denied commands | Active |
|
|
274
|
-
| **HTML posture report** | Interactive dark-theme HTML report with severity chart, filters, and agent activity | Active |
|
|
275
|
-
|
|
276
|
-
Shield operates in three modes:
|
|
277
|
-
- **Monitor** (default): Logs and surfaces security events for developer review.
|
|
278
|
-
- **Enforce**: Shell hooks call `opena2a shield evaluate` before each command. Denied commands are blocked with exit code 1.
|
|
279
|
-
- **Baseline learning**: Observes agent behavior across sessions and suggests policy rules when behavior stabilizes.
|
|
280
|
-
|
|
281
|
-
### Subcommands
|
|
282
|
-
|
|
283
|
-
#### `opena2a shield init`
|
|
284
|
-
|
|
285
|
-
Full environment scan: detects project type, scans for credentials, discovers AI assistants, MCP servers, and OAuth sessions, generates a YAML policy file, installs shell hooks, and writes a genesis event to the tamper-evident log.
|
|
286
|
-
|
|
287
|
-
```bash
|
|
288
|
-
opena2a shield init # Scan current directory
|
|
289
|
-
opena2a shield init --dir ./my-agent # Scan specific directory
|
|
290
|
-
opena2a shield init --format json # Single valid JSON document for CI
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
#### `opena2a shield status`
|
|
294
|
-
|
|
295
|
-
Shows tool availability, policy mode, shell integration, and integrity state.
|
|
296
|
-
|
|
297
|
-
```bash
|
|
298
|
-
opena2a shield status
|
|
299
|
-
opena2a shield status --format json
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
#### `opena2a shield log`
|
|
303
|
-
|
|
304
|
-
Query the tamper-evident event log with filters.
|
|
305
|
-
|
|
306
|
-
```bash
|
|
307
|
-
opena2a shield log # Last 20 events
|
|
308
|
-
opena2a shield log --count 50 # Last 50 events
|
|
309
|
-
opena2a shield log --severity high # High+ severity only
|
|
310
|
-
opena2a shield log --source arp # ARP runtime events
|
|
311
|
-
opena2a shield log --agent claude-code # Events from Claude Code
|
|
312
|
-
opena2a shield log --since 7d # Last 7 days
|
|
313
|
-
opena2a shield log --format json # JSON output
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
#### `opena2a shield selfcheck`
|
|
317
|
-
|
|
318
|
-
Runs five integrity checks: policy hash, shell hook content, event chain validity, process binary, and artifact signatures. Returns `healthy`, `degraded`, or `compromised` status. Event chain gaps (e.g., from log rotation) report as `degraded` rather than `compromised`, since they indicate data loss rather than tampering.
|
|
319
|
-
|
|
320
|
-
```bash
|
|
321
|
-
opena2a shield selfcheck
|
|
322
|
-
opena2a shield check # Alias
|
|
323
|
-
opena2a shield selfcheck --format json
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
#### `opena2a shield policy`
|
|
327
|
-
|
|
328
|
-
Show the loaded security policy (mode, rule counts, agent overrides).
|
|
329
|
-
|
|
330
|
-
```bash
|
|
331
|
-
opena2a shield policy
|
|
332
|
-
opena2a shield policy --format json
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
#### `opena2a shield evaluate`
|
|
336
|
-
|
|
337
|
-
Evaluate an action against the loaded policy. Returns `ALLOWED`, `BLOCKED`, or `MONITORED`. In enforce mode, shell hooks call this before every command and block denied actions.
|
|
338
|
-
|
|
339
|
-
```bash
|
|
340
|
-
opena2a shield evaluate --category processes --agent claude-code
|
|
341
|
-
opena2a shield evaluate "curl evil.com" # Evaluate a command string
|
|
342
|
-
opena2a shield evaluate --format json
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
#### `opena2a shield monitor`
|
|
346
|
-
|
|
347
|
-
Import ARP (Agent Runtime Protection) events into Shield's hash-chained log and display runtime stats.
|
|
348
|
-
|
|
349
|
-
```bash
|
|
350
|
-
opena2a shield monitor # Import events + show stats
|
|
351
|
-
opena2a shield monitor --agent cursor # Tag imported events
|
|
352
|
-
opena2a shield monitor --since 7d # Stats for last 7 days
|
|
353
|
-
opena2a shield monitor --format json
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
#### `opena2a shield report`
|
|
357
|
-
|
|
358
|
-
Generate a security posture report from event data. Includes severity breakdown, agent activity, policy violations, and top actions. Supports interactive HTML output.
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
opena2a shield report # Last 7 days (text)
|
|
362
|
-
opena2a shield report --report posture.html # Interactive HTML report
|
|
363
|
-
opena2a shield report --since 30d # Last 30 days
|
|
364
|
-
opena2a shield report --analyze # Include LLM narrative
|
|
365
|
-
opena2a shield report --format json
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
#### `opena2a shield session`
|
|
369
|
-
|
|
370
|
-
Detect the current AI coding assistant session. Identifies Claude Code, Cursor, GitHub Copilot, Windsurf, Aider, and Continue.
|
|
371
|
-
|
|
372
|
-
```bash
|
|
373
|
-
opena2a shield session
|
|
374
|
-
opena2a shield session --verbose # Show raw detection signals
|
|
375
|
-
opena2a shield session --format json
|
|
23
|
+
Run: opena2a protect (fix all findings)
|
|
376
24
|
```
|
|
377
25
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
Exit lockdown mode after integrity failures. Optionally re-verify before lifting lockdown.
|
|
26
|
+
Install globally if you prefer:
|
|
381
27
|
|
|
382
28
|
```bash
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
#### `opena2a shield suggest`
|
|
388
|
-
|
|
389
|
-
LLM-powered policy suggestion based on observed agent behavior. Requires LLM backend (enable with `opena2a config llm on`).
|
|
390
|
-
|
|
391
|
-
```bash
|
|
392
|
-
opena2a shield suggest # Suggest policy from all events
|
|
393
|
-
opena2a shield suggest --agent cursor # For specific agent
|
|
394
|
-
opena2a shield suggest --format json
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
#### `opena2a shield explain`
|
|
398
|
-
|
|
399
|
-
LLM-powered explanation of security events. Provides severity assessment, risk factors, and recommended actions.
|
|
400
|
-
|
|
401
|
-
```bash
|
|
402
|
-
opena2a shield explain # Explain most recent event
|
|
403
|
-
opena2a shield explain --count 5 # Explain last 5 events
|
|
404
|
-
opena2a shield explain --severity high # High+ severity only
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
#### `opena2a shield triage`
|
|
408
|
-
|
|
409
|
-
LLM-powered incident classification. Correlates multiple events and classifies as false-positive, suspicious, or confirmed-threat.
|
|
410
|
-
|
|
411
|
-
```bash
|
|
412
|
-
opena2a shield triage # Triage high+ severity events
|
|
413
|
-
opena2a shield triage --severity medium # Include medium severity
|
|
414
|
-
opena2a shield triage --agent windsurf # For specific agent
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
#### `opena2a shield baseline`
|
|
418
|
-
|
|
419
|
-
Manage per-agent behavioral baselines. Baselines track observed actions across sessions and compute stability scores to determine when behavior has converged enough to generate policy recommendations.
|
|
420
|
-
|
|
421
|
-
```bash
|
|
422
|
-
opena2a shield baseline # List all baselines
|
|
423
|
-
opena2a shield baseline claude-code # Show detail for specific agent
|
|
424
|
-
opena2a shield baseline --format json
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
Phases: **learning** (collecting observations) -> **stabilizing** (fewer new behaviors) -> **stable** (ready for policy generation). Stability is measured as the fraction of recent sessions with no previously-unseen behavior.
|
|
428
|
-
|
|
429
|
-
### CI Integration
|
|
430
|
-
|
|
431
|
-
Shield includes a GitHub Actions workflow for automated security checks on every PR.
|
|
432
|
-
|
|
433
|
-
```bash
|
|
434
|
-
# Copy the example workflow to your project
|
|
435
|
-
cp node_modules/opena2a-cli/examples/github-actions-shield.yml .github/workflows/shield.yml
|
|
29
|
+
npm install -g opena2a-cli
|
|
30
|
+
brew tap opena2a-org/tap && brew install opena2a
|
|
436
31
|
```
|
|
437
32
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
### Event Log Format
|
|
33
|
+
## Built-in Help
|
|
441
34
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
```
|
|
445
|
-
[2026-03-02T12:00:00Z] [HIGH] process.anomaly -> curl evil.com (monitored)
|
|
446
|
-
[2026-03-02T12:01:00Z] [CRITICAL] prompt.threat -> injection-attempt (blocked)
|
|
447
|
-
[2026-03-02T12:02:00Z] [INFO] process.spawn -> /usr/bin/ls (allowed)
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
### Quick Start
|
|
35
|
+
You do not need this README. The CLI has built-in discovery:
|
|
451
36
|
|
|
452
37
|
```bash
|
|
453
|
-
#
|
|
454
|
-
opena2a
|
|
455
|
-
|
|
456
|
-
#
|
|
457
|
-
opena2a trust express
|
|
458
|
-
|
|
459
|
-
# 3. Check what AI assistants are running
|
|
460
|
-
opena2a shield session
|
|
461
|
-
|
|
462
|
-
# 4. View security events
|
|
463
|
-
opena2a shield log --severity medium
|
|
464
|
-
|
|
465
|
-
# 5. Generate a posture report
|
|
466
|
-
opena2a shield report
|
|
467
|
-
|
|
468
|
-
# 6. Run integrity verification
|
|
469
|
-
opena2a shield selfcheck
|
|
38
|
+
opena2a ? # Contextual recommendations for your project
|
|
39
|
+
opena2a ~shadow ai # Semantic search across all commands
|
|
40
|
+
opena2a "find leaked credentials" # Natural language command matching
|
|
41
|
+
opena2a # Interactive guided wizard (no args)
|
|
470
42
|
```
|
|
471
43
|
|
|
472
|
-
##
|
|
44
|
+
## Commands
|
|
473
45
|
|
|
474
|
-
|
|
46
|
+
| Command | What it does |
|
|
47
|
+
|---------|-------------|
|
|
48
|
+
| `opena2a review` | Full security dashboard — HTML report, 6-phase assessment |
|
|
49
|
+
| `opena2a detect` | Find shadow AI agents, MCP servers, AI configs. Governance score. |
|
|
50
|
+
| `opena2a detect --report` | Executive HTML report |
|
|
51
|
+
| `opena2a detect --export-csv` | Asset inventory for CMDB/ServiceNow |
|
|
52
|
+
| `opena2a init` | Read-only security assessment with trust score |
|
|
53
|
+
| `opena2a protect` | Fix everything — credentials, .gitignore, config signing |
|
|
54
|
+
| `opena2a identity create` | Cryptographic identity for your project |
|
|
55
|
+
| `opena2a harden-soul` | Generate SOUL.md governance rules |
|
|
56
|
+
| `opena2a scan` | 163 security checks via HackMyAgent |
|
|
57
|
+
| `opena2a mcp audit` | Audit MCP server configurations with trust scores |
|
|
58
|
+
| `opena2a guard sign` | Sign config files for tamper detection |
|
|
59
|
+
| `opena2a shield init` | Full security setup — all of the above, one command |
|
|
475
60
|
|
|
476
|
-
|
|
477
|
-
opena2a # Interactive guided wizard
|
|
478
|
-
opena2a ~drift # Semantic search (finds protect, init)
|
|
479
|
-
opena2a ~api keys # Semantic search with domain expansion
|
|
480
|
-
opena2a ? # Context-aware recommendations
|
|
481
|
-
opena2a find leaked credentials # Natural language matching
|
|
482
|
-
opena2a detect hardcoded secrets # Natural language matching
|
|
483
|
-
```
|
|
61
|
+
## Ecosystem
|
|
484
62
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
## Adapter Commands
|
|
488
|
-
|
|
489
|
-
The CLI orchestrates these specialized tools through a unified interface:
|
|
63
|
+
Each command routes to a specialized tool, installed on first use:
|
|
490
64
|
|
|
491
65
|
| Command | Tool | Description |
|
|
492
66
|
|---------|------|-------------|
|
|
493
|
-
| `
|
|
494
|
-
| `
|
|
495
|
-
| `
|
|
496
|
-
| `
|
|
497
|
-
| `
|
|
498
|
-
| `
|
|
499
|
-
| `
|
|
500
|
-
| `opena2a crypto` | [CryptoServe](https://github.com/ecolibria/crypto-serve) | Cryptographic inventory, PQC readiness |
|
|
501
|
-
| `opena2a identity` | [AIM](https://github.com/opena2a-org/agent-identity-management) | Agent identity management |
|
|
502
|
-
| `opena2a broker` | [Secretless AI](https://github.com/opena2a-org/secretless-ai) | Identity-aware credential broker daemon |
|
|
503
|
-
| `opena2a dlp` | [Secretless AI](https://github.com/opena2a-org/secretless-ai) | Data loss prevention for AI tool transcripts |
|
|
504
|
-
| `opena2a trust` | [OpenA2A Registry](https://registry.opena2a.org) | Agent Trust Protocol lookup (npm, PyPI, GitHub) |
|
|
505
|
-
| `opena2a claim` | [OpenA2A Registry](https://registry.opena2a.org) | Claim ownership of a discovered agent |
|
|
506
|
-
|
|
507
|
-
Adapters install tools on first use. Each tool works standalone or through the CLI.
|
|
67
|
+
| `detect` | Shadow AI | Discover AI agents, MCP servers, AI configs |
|
|
68
|
+
| `identity` | [AIM](https://github.com/opena2a-org/agent-identity-management) | Cryptographic identity, audit logs, trust scoring |
|
|
69
|
+
| `scan` | [HackMyAgent](https://github.com/opena2a-org/hackmyagent) | 163 security checks, attack simulation, auto-fix |
|
|
70
|
+
| `secrets` | [Secretless AI](https://github.com/opena2a-org/secretless-ai) | Credential management for AI coding tools |
|
|
71
|
+
| `mcp` | MCP Security | Audit, sign, and verify MCP server configurations |
|
|
72
|
+
| `benchmark` | [OASB](https://github.com/opena2a-org/open-agent-security-benchmark) | 222 attack scenarios, compliance scoring |
|
|
73
|
+
| `train` | [DVAA](https://github.com/opena2a-org/damn-vulnerable-ai-agent) | Vulnerable AI agent for security training |
|
|
508
74
|
|
|
509
|
-
|
|
75
|
+
## Use Cases
|
|
510
76
|
|
|
511
|
-
|
|
77
|
+
- [Developer using AI coding tools](docs/use-cases/developer.md) — 5 minutes
|
|
78
|
+
- [Security team assessing AI risk](docs/use-cases/security-team.md) — 10 minutes
|
|
79
|
+
- [MCP server author](docs/use-cases/mcp-server-author.md) — 15 minutes
|
|
80
|
+
- [CI/CD pipeline integration](docs/use-cases/ci-cd.md)
|
|
512
81
|
|
|
513
|
-
|
|
514
|
-
opena2a identity list # Show local agent identity (ID, public key, creation date)
|
|
515
|
-
opena2a identity create --name bot # Create a new named identity
|
|
516
|
-
opena2a identity trust # Calculate and display trust score with factor breakdown
|
|
517
|
-
opena2a identity audit --limit 10 # Show recent audit events
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
Trust scores range from 0-100 and reflect how many security practices are active: identity (Ed25519 key), capability policies, audit logging, secrets management, config signing, skill verification, network controls, and heartbeat monitoring. The score shows a path forward, not a judgment.
|
|
521
|
-
|
|
522
|
-
## Behavioral Governance
|
|
82
|
+
## Docs
|
|
523
83
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
### `opena2a scan-soul`
|
|
527
|
-
|
|
528
|
-
Scan your governance file (SOUL.md or equivalent) against ABGS controls for your agent's capability tier. Auto-detects tier from file content.
|
|
529
|
-
|
|
530
|
-
```bash
|
|
531
|
-
opena2a scan-soul # Scan SOUL.md in current directory
|
|
532
|
-
opena2a scan-soul ./agent/ # Scan specific directory
|
|
533
|
-
opena2a scan-soul --tier TOOL-USING # Force TOOL-USING tier (54 controls)
|
|
534
|
-
opena2a scan-soul --tier AGENTIC # Force AGENTIC tier (65 controls)
|
|
535
|
-
opena2a scan-soul --tier MULTI-AGENT # Force MULTI-AGENT tier (68 controls)
|
|
536
|
-
opena2a scan-soul --json # Machine-readable output for CI
|
|
537
|
-
opena2a scan-soul --deep # Enable LLM semantic analysis (requires ANTHROPIC_API_KEY)
|
|
538
|
-
opena2a scan-soul --fail-below 60 # Exit 1 if score below threshold
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
Tier-to-control mapping:
|
|
542
|
-
|
|
543
|
-
| Tier | Controls | Use Case |
|
|
544
|
-
|------|----------|----------|
|
|
545
|
-
| `BASIC` | 27 | Single-turn chatbots, no tool use |
|
|
546
|
-
| `TOOL-USING` | 54 | Agents with tool/function calling |
|
|
547
|
-
| `AGENTIC` | 65 | Long-running, multi-step autonomous agents |
|
|
548
|
-
| `MULTI-AGENT` | 68 | Orchestrators and sub-agent systems |
|
|
549
|
-
|
|
550
|
-
Governance file search order: `SOUL.md` > `system-prompt.md` > `CLAUDE.md` > `.cursorrules` > `agent-config.yaml` (and more).
|
|
551
|
-
|
|
552
|
-
Conformance levels shown in output:
|
|
553
|
-
- `none` — a critical control is missing (grade capped at C)
|
|
554
|
-
- `essential` — all critical controls pass
|
|
555
|
-
- `standard` — all critical + high controls pass, score ≥ 60
|
|
556
|
-
- `hardened` — all controls pass, score ≥ 75
|
|
557
|
-
|
|
558
|
-
### `opena2a harden-soul`
|
|
559
|
-
|
|
560
|
-
Generate a SOUL.md governance file, or add missing sections to an existing one. Existing content is always preserved.
|
|
561
|
-
|
|
562
|
-
```bash
|
|
563
|
-
opena2a harden-soul # Add missing sections to SOUL.md
|
|
564
|
-
opena2a harden-soul ./agent/ # Target specific directory
|
|
565
|
-
opena2a harden-soul --dry-run # Preview what would be added, no writes
|
|
566
|
-
opena2a harden-soul --json # Machine-readable output
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
The 8 ABGS behavioral domains (OASB v2, domains 7-14):
|
|
570
|
-
|
|
571
|
-
| Domain | What it governs |
|
|
572
|
-
|--------|----------------|
|
|
573
|
-
| Trust Hierarchy | Principal relationships, conflict resolution |
|
|
574
|
-
| Capability Boundaries | Allowed/denied actions, least privilege |
|
|
575
|
-
| Injection Hardening | Prompt injection defense, encoded payload rejection |
|
|
576
|
-
| Data Handling | PII protection, credential handling, data minimization |
|
|
577
|
-
| Hardcoded Behaviors | Immutable safety rules (no exfiltration, kill switch) |
|
|
578
|
-
| Agentic Safety | Iteration limits, budget caps, rollback, plan disclosure |
|
|
579
|
-
| Honesty and Transparency | Uncertainty acknowledgment, identity disclosure |
|
|
580
|
-
| Human Oversight | Approval gates, override mechanisms, monitoring |
|
|
581
|
-
|
|
582
|
-
## CI/CD Integration
|
|
583
|
-
|
|
584
|
-
Several commands support `--json` output and `--fail-below` for pipeline gates:
|
|
585
|
-
|
|
586
|
-
```yaml
|
|
587
|
-
# GitHub Actions example
|
|
588
|
-
- name: Credential check
|
|
589
|
-
run: |
|
|
590
|
-
npx opena2a-cli protect --dry-run --json > cred-report.json
|
|
591
|
-
jq -e '.totalFound == 0' cred-report.json
|
|
592
|
-
|
|
593
|
-
- name: Behavioral governance gate
|
|
594
|
-
run: npx opena2a-cli scan-soul --json --fail-below 60
|
|
595
|
-
|
|
596
|
-
- name: Config integrity
|
|
597
|
-
run: npx opena2a-cli guard verify
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
## Output Formats
|
|
601
|
-
|
|
602
|
-
| Format | Flag | Use Case |
|
|
603
|
-
|--------|------|----------|
|
|
604
|
-
| Text | (default) | Human-readable terminal output |
|
|
605
|
-
| JSON | `--json` | CI pipelines, programmatic consumption |
|
|
606
|
-
| HTML | `--report <path>` | Interactive report (protect and shield commands) |
|
|
607
|
-
|
|
608
|
-
## Credential Patterns
|
|
609
|
-
|
|
610
|
-
Detected credential types and their finding IDs:
|
|
611
|
-
|
|
612
|
-
| ID | Pattern | Severity |
|
|
613
|
-
|----|---------|----------|
|
|
614
|
-
| CRED-001 | Anthropic API Key (`sk-ant-api*`) | Critical |
|
|
615
|
-
| CRED-002 | OpenAI API Key (`sk-*`, `sk-proj-*`, `sk-test-*`) | Critical |
|
|
616
|
-
| CRED-003 | GitHub Token (`ghp_*`, `ghs_*`) | High |
|
|
617
|
-
| CRED-004 | Generic API Key in assignment | Medium |
|
|
618
|
-
| DRIFT-001 | Google API Key with Gemini drift (`AIza*`) | High |
|
|
619
|
-
| DRIFT-002 | AWS Access Key with Bedrock drift (`AKIA*`) | High |
|
|
620
|
-
|
|
621
|
-
Language-aware replacements:
|
|
622
|
-
|
|
623
|
-
| Language | Replacement |
|
|
624
|
-
|----------|-------------|
|
|
625
|
-
| JavaScript/TypeScript | `process.env.VAR_NAME` |
|
|
626
|
-
| Python | `os.environ.get('VAR_NAME')` |
|
|
627
|
-
| Go | `os.Getenv("VAR_NAME")` |
|
|
628
|
-
| Ruby | `ENV['VAR_NAME']` |
|
|
629
|
-
| Java/Kotlin | `System.getenv("VAR_NAME")` |
|
|
630
|
-
| Rust | `std::env::var("VAR_NAME").unwrap_or_default()` |
|
|
631
|
-
| YAML/TOML/JSON | `${VAR_NAME}` |
|
|
84
|
+
Full command reference, Shield subcommands, scope drift detection, behavioral governance, credential patterns, and CI/CD examples: [opena2a.org/docs](https://opena2a.org/docs)
|
|
632
85
|
|
|
633
86
|
## Requirements
|
|
634
87
|
|
|
635
88
|
- Node.js >= 18
|
|
636
89
|
- Optional: Docker (for `opena2a train`)
|
|
637
|
-
- Optional: Python 3.9+ (for `opena2a crypto`)
|
|
638
90
|
|
|
639
91
|
## License
|
|
640
92
|
|
|
@@ -642,8 +94,4 @@ Apache-2.0
|
|
|
642
94
|
|
|
643
95
|
---
|
|
644
96
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
[Report an Issue](https://github.com/opena2a-org/opena2a/issues) | [Contribute](https://github.com/opena2a-org/opena2a/blob/main/CONTRIBUTING.md)
|
|
648
|
-
|
|
649
|
-
</div>
|
|
97
|
+
[Website](https://opena2a.org) · [Docs](https://opena2a.org/docs) · [Discord](https://discord.gg/uRZa3KXgEn) · [GitHub](https://github.com/opena2a-org/opena2a)
|