Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions agentbom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# agentbom — reference implementation of the three trust artifact types

A dependency-free Go reference implementation of the three WasmAgent trust
artifact types shipped by [Milestone 1](../docs/15-milestones.md):

| Artifact | JSON format marker | Purpose |
|---|---|---|
| `AgentBOM` | `bomFormat: "AgentBOM"` | Versioned bill of materials for an agent (runtime, tools, model, dependencies) |
| `MCPPosture` | `postureFormat: "MCPPosture"` | Declared MCP surface and capability envelope (servers, tools, allowed operations, restricted paths) |
| `TrustPassport` | `passportFormat: "TrustPassport"` | Portable, verifiable bundle: identity, posture snapshot, signed evidence references, trust score |

The JSON shapes mirror the canonical fixtures in `tests/e2e/fixtures/` and the
JSON Schemas referenced by their `$schema` fields
(`https://wasmagent.github.io/agent-trust-infra/schemas/`).

## Usage

```go
package main

import (
"fmt"

Check failure on line 22 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:22:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md

"github.com/WasmAgent/.github/agentbom"

Check failure on line 24 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:24:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
)

func main() {
// Code-generated reference samples for all three artifact types.

Check failure on line 28 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:28:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
bom := agentbom.NewReferenceAgentBOM()

Check failure on line 29 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:29:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
posture := agentbom.NewReferenceMCPPosture()

Check failure on line 30 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:30:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md

// Validate any artifact against the reference schema.

Check failure on line 32 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:32:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
if err := agentbom.Validate(bom); err != nil {

Check failure on line 33 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:33:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
panic(err)

Check failure on line 34 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:34:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
}

Check failure on line 35 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:35:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md

// Link an AgentBOM + MCP Posture into a Trust Passport.

Check failure on line 37 in agentbom/README.md

View workflow job for this annotation

GitHub Actions / Lint Markdown

Hard tabs

agentbom/README.md:37:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
passport, err := agentbom.BuildTrustPassport(
agentbom.PassportIdentity{
AgentID: "github.com/WasmAgent/golden-path-agent",
Version: "1.0.0",
Timestamp: "2026-07-07T00:00:00Z",
},
bom,
posture,
[]agentbom.EvidenceRef{
{Type: "AEP", Location: "evidence/events.jsonl", Signature: "ed25519:..."},
},
0.95,
)
if err != nil {
panic(err)
}
fmt.Println(passport.TrustScore)
}
```

## API

- `ParseAgentBOM`, `ParseMCPPosture`, `ParseTrustPassport` — parse and
validate a JSON document for the respective artifact type.
- `Validate(artifact)` — validate any of the three artifact types against its
reference schema.
- `NewReferenceAgentBOM`, `NewReferenceMCPPosture`,
`NewReferenceTrustPassport` — code-generated reference samples.
- `BuildTrustPassport(identity, bom, posture, evidence, trustScore)` — the
reference chain: derives a Trust Passport that is consistent with a
validated AgentBOM and MCP Posture.

All artifact types implement `Validate() error`. The package has no external
dependencies and is safe to embed in generators, CI gates, or downstream
tooling.

## Tests

```bash
cd agentbom
go test ./...
```

The test suite covers all three artifact types: reference-sample validity,
JSON round-trips, schema rejection cases, conformance against the canonical
`tests/e2e/fixtures/` documents, and the `BuildTrustPassport` chain.
Loading
Loading