opena2a-cli 0.5.6 → 0.5.8

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 (63) hide show
  1. package/README.md +42 -10
  2. package/dist/commands/atp-types.d.ts +70 -0
  3. package/dist/commands/atp-types.d.ts.map +1 -0
  4. package/dist/commands/atp-types.js +8 -0
  5. package/dist/commands/atp-types.js.map +1 -0
  6. package/dist/commands/claim.d.ts +42 -0
  7. package/dist/commands/claim.d.ts.map +1 -0
  8. package/dist/commands/claim.js +437 -0
  9. package/dist/commands/claim.js.map +1 -0
  10. package/dist/commands/detect.js +1 -1
  11. package/dist/commands/detect.js.map +1 -1
  12. package/dist/commands/guard-policy.js +1 -1
  13. package/dist/commands/guard-policy.js.map +1 -1
  14. package/dist/commands/guard.js +1 -1
  15. package/dist/commands/guard.js.map +1 -1
  16. package/dist/commands/identity.js +1 -1
  17. package/dist/commands/identity.js.map +1 -1
  18. package/dist/commands/init.d.ts.map +1 -1
  19. package/dist/commands/init.js +4 -2
  20. package/dist/commands/init.js.map +1 -1
  21. package/dist/commands/mcp-audit.d.ts.map +1 -1
  22. package/dist/commands/mcp-audit.js +1 -0
  23. package/dist/commands/mcp-audit.js.map +1 -1
  24. package/dist/commands/review.js +10 -10
  25. package/dist/commands/review.js.map +1 -1
  26. package/dist/commands/runtime.d.ts +9 -0
  27. package/dist/commands/runtime.d.ts.map +1 -1
  28. package/dist/commands/runtime.js +33 -0
  29. package/dist/commands/runtime.js.map +1 -1
  30. package/dist/commands/shield.js +1 -1
  31. package/dist/commands/shield.js.map +1 -1
  32. package/dist/commands/trust.d.ts +30 -0
  33. package/dist/commands/trust.d.ts.map +1 -0
  34. package/dist/commands/trust.js +295 -0
  35. package/dist/commands/trust.js.map +1 -0
  36. package/dist/index.js +61 -5
  37. package/dist/index.js.map +1 -1
  38. package/dist/natural/intent-map.js +2 -2
  39. package/dist/natural/intent-map.js.map +1 -1
  40. package/dist/router.d.ts.map +1 -1
  41. package/dist/router.js +27 -0
  42. package/dist/router.js.map +1 -1
  43. package/dist/semantic/command-index.json +13 -4
  44. package/dist/shield/detect.d.ts.map +1 -1
  45. package/dist/shield/detect.js +1 -0
  46. package/dist/shield/detect.js.map +1 -1
  47. package/dist/shield/init.d.ts +9 -0
  48. package/dist/shield/init.d.ts.map +1 -1
  49. package/dist/shield/init.js +25 -21
  50. package/dist/shield/init.js.map +1 -1
  51. package/dist/shield/integrity.js +6 -6
  52. package/dist/shield/integrity.js.map +1 -1
  53. package/dist/util/ai-config.d.ts.map +1 -1
  54. package/dist/util/ai-config.js +1 -1
  55. package/dist/util/ai-config.js.map +1 -1
  56. package/dist/util/detect.d.ts.map +1 -1
  57. package/dist/util/detect.js +32 -6
  58. package/dist/util/detect.js.map +1 -1
  59. package/dist/util/report-submission.js +1 -1
  60. package/dist/util/report-submission.js.map +1 -1
  61. package/dist/util/scoring.js +5 -5
  62. package/dist/util/scoring.js.map +1 -1
  63. package/package.json +1 -1
package/README.md CHANGED
@@ -39,10 +39,10 @@ No configuration required. Works with Node.js, Python, Go, and MCP server projec
39
39
 
40
40
  ## What It Does
41
41
 
42
- Run `opena2a init` in any project directory to get an instant security assessment:
42
+ Run `opena2a init` in any project directory to get a read-only security assessment:
43
43
 
44
44
  ```
45
- OpenA2A Security Report v0.5.5
45
+ OpenA2A Security Report v0.5.7
46
46
 
47
47
  Project myapp v2.1.0
48
48
  Type Node.js + MCP server
@@ -117,7 +117,7 @@ opena2a review --format json # JSON output for CI
117
117
 
118
118
  ### `opena2a init`
119
119
 
120
- Assess your project's security posture. Detects project type, scans for credentials, checks hygiene (`.gitignore`, `.env` protection, lock file, security config), calculates a trust score (0-100), and provides prioritized next steps.
120
+ 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.
121
121
 
122
122
  ```bash
123
123
  opena2a init # Assess current directory
@@ -126,6 +126,8 @@ opena2a init --verbose # Show individual credential details
126
126
  opena2a init --format json # Machine-readable output for CI
127
127
  ```
128
128
 
129
+ For a full security orchestration (credential scanning, policy generation, shell hooks, event log), use `opena2a shield init` instead.
130
+
129
131
  ### `opena2a protect`
130
132
 
131
133
  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.
@@ -197,6 +199,31 @@ opena2a config contribute on # Enable community data sharing
197
199
  opena2a config llm on # Enable LLM-powered command matching
198
200
  ```
199
201
 
202
+ ### `opena2a trust`
203
+
204
+ Look up the trust profile for an AI agent or MCP server from the OpenA2A Trust Registry (Agent Trust Protocol).
205
+
206
+ ```bash
207
+ opena2a trust express # Look up npm package
208
+ opena2a trust langchain --source pypi # Look up PyPI package
209
+ opena2a trust https://github.com/org/repo # GitHub URL (auto-parsed)
210
+ opena2a trust # Auto-detect from package.json in cwd
211
+ opena2a trust express --json # Machine-readable output
212
+ opena2a trust express --verbose # Show full posture details
213
+ ```
214
+
215
+ Defaults to npm as the source when `--source` is not specified. Supports `npm`, `pypi`, and `github` sources.
216
+
217
+ ### `opena2a claim`
218
+
219
+ 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.
220
+
221
+ ```bash
222
+ opena2a claim my-agent # Claim via npm ownership verification
223
+ opena2a claim # Auto-detect from package.json in cwd
224
+ opena2a claim my-agent --json # Machine-readable output
225
+ ```
226
+
200
227
  ## Shield: Unified Security Orchestration
201
228
 
202
229
  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.
@@ -240,7 +267,7 @@ Full environment scan: detects project type, scans for credentials, discovers AI
240
267
  ```bash
241
268
  opena2a shield init # Scan current directory
242
269
  opena2a shield init --dir ./my-agent # Scan specific directory
243
- opena2a shield init --format json # Machine-readable output
270
+ opena2a shield init --format json # Single valid JSON document for CI
244
271
  ```
245
272
 
246
273
  #### `opena2a shield status`
@@ -268,7 +295,7 @@ opena2a shield log --format json # JSON output
268
295
 
269
296
  #### `opena2a shield selfcheck`
270
297
 
271
- Runs five integrity checks: policy hash, shell hook content, event chain validity, process binary, and artifact signatures. Returns `healthy`, `degraded`, or `compromised` status.
298
+ 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.
272
299
 
273
300
  ```bash
274
301
  opena2a shield selfcheck
@@ -403,19 +430,22 @@ Shield maintains a tamper-evident event log. Events are stored in the project-lo
403
430
  ### Quick Start
404
431
 
405
432
  ```bash
406
- # 1. Initialize Shield in your project
433
+ # 1. Initialize Shield (full 11-step orchestration)
407
434
  opena2a shield init
408
435
 
409
- # 2. Check what AI assistants are running
436
+ # 2. Look up trust profiles for your dependencies
437
+ opena2a trust express
438
+
439
+ # 3. Check what AI assistants are running
410
440
  opena2a shield session
411
441
 
412
- # 3. View security events
442
+ # 4. View security events
413
443
  opena2a shield log --severity medium
414
444
 
415
- # 4. Generate a posture report
445
+ # 5. Generate a posture report
416
446
  opena2a shield report
417
447
 
418
- # 5. Run integrity verification
448
+ # 6. Run integrity verification
419
449
  opena2a shield selfcheck
420
450
  ```
421
451
 
@@ -451,6 +481,8 @@ The CLI orchestrates these specialized tools through a unified interface:
451
481
  | `opena2a identity` | [AIM](https://github.com/opena2a-org/agent-identity-management) | Agent identity management |
452
482
  | `opena2a broker` | [Secretless AI](https://github.com/opena2a-org/secretless-ai) | Identity-aware credential broker daemon |
453
483
  | `opena2a dlp` | [Secretless AI](https://github.com/opena2a-org/secretless-ai) | Data loss prevention for AI tool transcripts |
484
+ | `opena2a trust` | [OpenA2A Registry](https://registry.opena2a.org) | Agent Trust Protocol lookup (npm, PyPI, GitHub) |
485
+ | `opena2a claim` | [OpenA2A Registry](https://registry.opena2a.org) | Claim ownership of a discovered agent |
454
486
 
455
487
  Adapters install tools on first use. Each tool works standalone or through the CLI.
456
488
 
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Agent Trust Protocol (ATP) types.
3
+ * TypeScript interfaces for the public trust lookup and claim APIs
4
+ * on the OpenA2A Registry.
5
+ */
6
+ export interface TrustPosture {
7
+ hardeningPassRate: number;
8
+ oasbCompliance: number;
9
+ soulConformance: string;
10
+ attackSurfaceRisk: string;
11
+ supplyChainHealth: number;
12
+ a2asCertified: boolean;
13
+ }
14
+ export interface TrustFactors {
15
+ verification: number;
16
+ uptime: number;
17
+ actionSuccess: number;
18
+ securityAlerts: number;
19
+ compliance: number;
20
+ age: number;
21
+ drift: number;
22
+ feedback: number;
23
+ }
24
+ export type TrustLevel = 'discovered' | 'scanned' | 'claimed' | 'verified' | 'certified';
25
+ export interface SupplyChainInfo {
26
+ totalDependencies: number;
27
+ criticalVulnerabilities: number;
28
+ highVulnerabilities: number;
29
+ lastPublished: string;
30
+ maintainerCount: number;
31
+ }
32
+ export interface TrustLookupResponse {
33
+ agentId: string;
34
+ name: string;
35
+ source: string;
36
+ version: string;
37
+ publisher: string;
38
+ publisherVerified: boolean;
39
+ trustScore: number;
40
+ trustLevel: TrustLevel;
41
+ posture?: TrustPosture;
42
+ factors?: TrustFactors;
43
+ capabilities?: string[];
44
+ supplyChain?: SupplyChainInfo;
45
+ lastScanned: string;
46
+ profileUrl: string;
47
+ }
48
+ export interface OwnershipProof {
49
+ method: 'npm' | 'github' | 'pypi';
50
+ /** npm: username, github: owner/repo, pypi: token prefix */
51
+ identity: string;
52
+ /** Opaque proof payload (varies by method) */
53
+ evidence: string;
54
+ }
55
+ export interface ClaimRequest {
56
+ agentId: string;
57
+ proof: OwnershipProof;
58
+ publicKey: string;
59
+ }
60
+ export interface ClaimResponse {
61
+ success: boolean;
62
+ agentId: string;
63
+ previousTrustLevel: TrustLevel;
64
+ newTrustLevel: TrustLevel;
65
+ previousTrustScore: number;
66
+ newTrustScore: number;
67
+ profileUrl: string;
68
+ error?: string;
69
+ }
70
+ //# sourceMappingURL=atp-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atp-types.d.ts","sourceRoot":"","sources":["../../src/commands/atp-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,YAAY;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;AAEzF,MAAM,WAAW,eAAe;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClC,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,cAAc,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,UAAU,CAAC;IAC/B,aAAa,EAAE,UAAU,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Agent Trust Protocol (ATP) types.
4
+ * TypeScript interfaces for the public trust lookup and claim APIs
5
+ * on the OpenA2A Registry.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=atp-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atp-types.js","sourceRoot":"","sources":["../../src/commands/atp-types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * opena2a claim -- Claim ownership of a discovered agent in the trust registry.
3
+ * Verifies package ownership via npm, GitHub, or PyPI and links the profile
4
+ * to the developer's verified identity.
5
+ *
6
+ * Usage:
7
+ * opena2a claim @anthropic/mcp-server-fetch
8
+ * opena2a claim langchain --source pypi
9
+ * opena2a claim # reads package.json in cwd
10
+ */
11
+ import type { TrustLookupResponse, OwnershipProof, ClaimResponse } from './atp-types.js';
12
+ export interface ClaimOptions {
13
+ packageName?: string;
14
+ source?: string;
15
+ registryUrl?: string;
16
+ ci?: boolean;
17
+ format?: 'text' | 'json';
18
+ json?: boolean;
19
+ verbose?: boolean;
20
+ }
21
+ export declare const _internals: {
22
+ readLocalPackageName(): string | null;
23
+ fetchTrustLookup(registryUrl: string, packageName: string, source?: string): Promise<{
24
+ ok: boolean;
25
+ status: number;
26
+ data?: TrustLookupResponse;
27
+ }>;
28
+ verifyNpmOwnership(packageName: string): Promise<OwnershipProof | null>;
29
+ verifyGithubOwnership(packageName: string): Promise<OwnershipProof | null>;
30
+ generateKeypair(): Promise<{
31
+ publicKey: string;
32
+ privateKey: string;
33
+ }>;
34
+ submitClaim(registryUrl: string, agentId: string, proof: OwnershipProof, publicKey: string): Promise<{
35
+ ok: boolean;
36
+ status: number;
37
+ data?: ClaimResponse;
38
+ }>;
39
+ storeKeypair(agentId: string, publicKey: string, privateKey: string): Promise<string>;
40
+ };
41
+ export declare function claim(options: ClaimOptions): Promise<number>;
42
+ //# sourceMappingURL=claim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/commands/claim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAQD,eAAO,MAAM,UAAU;4BACG,MAAM,GAAG,IAAI;kCActB,MAAM,eACN,MAAM,WACV,MAAM,GACd,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,mBAAmB,CAAA;KAAE,CAAC;oCAmBjC,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;uCA6BpC,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;uBAmDvD,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;6BAY5D,MAAM,WACV,MAAM,SACR,cAAc,aACV,MAAM,GAChB,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,aAAa,CAAA;KAAE,CAAC;0BAoCrC,MAAM,aAAa,MAAM,cAAc,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAiB5F,CAAC;AAIF,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CA2PlE"}