aien-protocols-mv
Canonical specifications, wire protocols, and schemas for the AIEN sovereign ecosystem
Brought by drakestapleton
GitHub aien-dev/aien-protocols-mv#62 (code only)
Apply it
git checkout -b patch-5628bfb806113b97 f3785177fcaaab7c0f2ce1126616e9fecb4e47b4 curl -fsSL https://interplane.io/drakestapleton/aien-protocols-mv/patches/5628bfb806113b97.patch | git am
Provenance
github-import 1
aien-dev/aien-protocols-mv
62
792e3264b3fb9ee2cf6b97bd556cc9c5c8b030c4
{"kind":"github-import","owner":"aien-dev","repo":"aien-protocols-mv","number":62,"url":"https://github.com/aien-dev/aien-protocols-mv/pull/62","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:39:46Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c0337ff --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# Dependabot: monthly version updates for the pinned GitHub Actions and the Cargo lockfile. +# Pull requests only; nothing merges itself. Security advisories are handled by GitHub +# Dependabot security updates on the repository settings. +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + - package-ecosystem: cargo + directory: / + schedule: + interval: monthly + versioning-strategy: lockfile-only diff --git a/.github/workflows/aien-verification.yml b/.github/workflows/aien-verification.yml index d82fc0c..6271851 100644 --- a/.github/workflows/aien-verification.yml +++ b/.github/workflows/aien-verification.yml @@ -30,7 +30,7 @@ jobs: RECEIPTS_RAW: https://raw.githubusercontent.com/aien-dev/aien-receipts/main steps: - name: Checkout the head under test - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: fetch-depth: 0 @@ -52,7 +52,7 @@ jobs: fi - name: Checkout the pinned crumb tool source (aien-architecture @ 12ad0141b41ec67ef5aa51cb4e1815894c1083bb) - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: repository: aien-dev/aien-architecture ref: 12ad0141b41ec67ef5aa51cb4e1815894c1083bb @@ -69,13 +69,13 @@ jobs: run: crumb verify . - name: Install Stable Rust Toolchain (for the pinned aien-test build) - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable branch head 2026-10-26 if: steps.anchors.outputs.enrolled == 'true' with: components: rustfmt - name: Checkout the pinned aien-test source (aien-sovereign-core @ ${{ env.AIEN_TEST_PIN }}) - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 if: steps.anchors.outputs.enrolled == 'true' with: repository: aien-dev/aien-sovereign-core @@ -88,7 +88,7 @@ jobs: # Cache dependencies only, never verifier executables or candidate-controlled target output. - name: Cache the pinned aien-test dependencies - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 if: steps.anchors.outputs.enrolled == 'true' with: path: | @@ -139,7 +139,7 @@ jobs: RECEIPTS_RAW: https://raw.githubusercontent.com/aien-dev/aien-receipts/main steps: - name: Checkout the tagged commit - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: fetch-depth: 0 @@ -166,12 +166,12 @@ jobs: echo "verify.pub (origin/main): $(cat "$RUNNER_TEMP/anchors/verify.pub")" - name: Install Stable Rust Toolchain (for the pinned aien-test build) - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable branch head 2026-10-26 with: components: rustfmt - name: Checkout the pinned aien-test source (aien-sovereign-core @ ${{ env.AIEN_TEST_PIN }}) - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: repository: aien-dev/aien-sovereign-core ref: ${{ env.AIEN_TEST_PIN }} @@ -182,7 +182,7 @@ jobs: # Cache dependencies only, never verifier executables or candidate-controlled target output. - name: Cache the pinned aien-test dependencies - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: | ~/.cargo/registry diff --git a/.github/workflows/sbom.yml b/.github/workflows/sbom.yml new file mode 100644 index 0000000..8b8c9df --- /dev/null +++ b/.github/workflows/sbom.yml @@ -0,0 +1,23 @@ +# SBOM: writes an SPDX JSON inventory of the tree at every push to main and on pull requests, as +# a workflow artifact, so outside auditors can diff what a commit contains. Read-only token; +# every action pinned by full commit sha. It judges nothing and gates nothing. +name: SBOM +on: + pull_request: + push: + branches: [main] +permissions: + contents: read +jobs: + sbom: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false + - uses: anchore/sbom-action@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3 + with: + path: . + format: spdx-json + artifact-name: sbom-${{ github.sha }}.spdx.json diff --git a/AUDIT_SCOPE.md b/AUDIT_SCOPE.md new file mode 100644 index 0000000..a3775e1 --- /dev/null +++ b/AUDIT_SCOPE.md @@ -0,0 +1,120 @@ +# Audit scope + +Written for an outside, independent security audit. Revision described: +`f3785177fcaaab7c0f2ce1126616e9fecb4e47b4` on `main`, 2026-10-26. Everything below is taken from +the repository's own files at that revision; items marked NOT_RUN were not executed while writing +this document. + +## What this repository is + +The written contracts the parts of AIEN agree on: byte formats and rules for agent state, +inference, evaluation, evidence receipts, crumbs, execution transcripts, compiled Omega units, the +Omega shell platform boundary, and task messages between a Raspberry Pi and the DGX Spark. Each +contract is a specification in `specs/`, often with test vectors and a small C checker. Ten +reference Rust crates live in `crates/`. Implementations live with their owners, not here. +Status (README, 2026-10-19): research grade, pre-alpha. `osc-unit-artifact` v1 is FROZEN, +`crumb-visible` is Stable, the rest are drafts. No protocol is claimed as qualified on hardware. + +## What to review, in priority order + +1. `specs/osc-unit-artifact/`: the signed container for a compiled Omega unit (frozen; consumers + carry copies of its vectors). Signature coverage, canonical encoding, the committed public keys + `keys/owner1.pub` and `keys/test1.pub`, `tools/check-vectors.sh`. +2. `crates/aien-provenance`: digests, Merkle trees, signature checks. +3. `crates/aien-action-protocol`: actions, capability grants, confinement authorization; + `SourceGrant::compute_unsigned_digest` (the V2 transcript described in the README, a breaking + change approved 2026-10-26). +4. `specs/verified-crumb/` (VC1) and `specs/evidence-receipt/`, `specs/evidence/` (AEI1), + `crates/aien-evaluation-protocol`. +5. `specs/execution-transcript/` (TRN1) C verifier; `specs/pi-spark-task/` (PST1) C checker and + `crates/aien-pi-spark-task` reader and writer. +6. `specs/osh-platform/`, `specs/crumb-visible/`, remaining crates. +7. `tests/gates/run.sh` (steps `crumb-verify`, `fmt`, `check`, `clippy`, `test`, + `zero-disk-secrets`, `anti-slop`, `c-vectors`), `.aien/always`, `.aien/unmapped-ok`, + `.aien/verify.pub`. +8. Workflows: `aien-verification.yml` (pull request and push, `contents: read`, advisory; checks + the Spark's signed result) and `sbom.yml` (SPDX inventory artifact, `contents: read`, actions + pinned by commit sha, gates nothing). + +AGENTS.md: a change to `.aien/`, `tests/gates/` or `.github/workflows/` is `BLOCKED_OPERATOR` and +runs only when the operator starts it by hand. + +## Trust boundaries + +- Untrusted: every byte stream a conforming reader parses (artifacts, transcripts, PST1 headers, + crumb records); pull request heads. +- Trusted: signing keys named by each specification; `.aien/verify.pub` on `main`. +- The DGX Spark is the only test judge and runs `tests/gates/run.sh`; GitHub checks are advisory + and build nothing from this repository (AGENTS.md, `docs/PIPELINE.md`). +- Rule of direction: protocols point inward to nothing; implementations point downward. + +## Threat model summary + +- Assets: the meaning of each wire format; signature and digest bindings; vectors that consumers + copy. +- Attackers considered: a producer of crafted input aiming for a reader to accept it or to parse it + differently from another reader; a pull request that edits vectors to make a checker pass. +- Defended: vectors with fixed verdicts and C checkers that must pass in the same pull request as + any text change; frozen status for osc-unit-artifact v1; zero-disk-secrets gate. +- Not defended: draft specifications may change; several have no checker in this repository + ("nothing yet" in the README table); TRN1 and PST1 are not yet produced by any runtime. +- Explicitly out of scope: owner implementations in other repositories. + +## Build from source at a pin + +Stable Rust (no `rust-toolchain.toml`); bash, coreutils and a C99 compiler for the checkers. +`Cargo.lock` is committed. + +```sh +git clone https://github.com/aien-dev/aien-protocols-mv.git +cd aien-protocols-mv +git checkout f3785177fcaaab7c0f2ce1126616e9fecb4e47b4 +cargo check --workspace --all-targets +``` + +## Run every test + +```sh +cargo fmt --all -- --check +cargo check --workspace --all-targets +cargo clippy --workspace --all-targets -- -D warnings +cargo test --workspace +bash specs/verified-crumb/tools/check-golden.sh +bash specs/osc-unit-artifact/tools/check-vectors.sh +bash specs/execution-transcript/tools/check-corpus.sh +bash specs/pi-spark-task/tools/check-vectors.sh +bash specs/osh-platform/tools/check-stream-vectors.sh +tests/gates/run.sh c-vectors +tests/gates/run.sh zero-disk-secrets +tests/gates/run.sh anti-slop +tests/gates/run.sh crumb-verify +``` + +- `.aien/always`: `CRUMB-VERIFY`, `PROTO-ZERO-DISK-SECRETS`, `PROTO-ANTI-SLOP`. +- `crumb-verify` uses `crumb` on `PATH` or the one named by `CRUMB`. +- README: on 2026-10-19 all of these passed on the Spark on `main` at `fb5fca9`, and + `crumb verify .` printed `OK: 41 crumbs current`. +- All commands above: NOT_RUN while writing this document. + +## Known limitations and NOT_RUN + +- `evidence-receipt` is a partial extraction; the full extraction is owed. +- `agent-state` and `inference` have no checker here. +- The SourceGrant V2 digest requires reissuing every previously signed grant. +- `aien-verification.yml` sets `REPO_SLUG: aien-dev/aien-protocols` while this repository is + `aien-dev/aien-protocols-mv`; whether GitHub redirects this is unknown from the repository. +- No fuzzing campaign is recorded in the repository. + +## Dependencies and provenance + +- Crates.io dependencies locked in `Cargo.lock` (197 packages). The C checkers use only a C99 + compiler and coreutils; no outside dependencies in the trusted base (AGENTS.md). +- Licences: specifications under the Community Specification License 1.0 (`LICENSE-SPEC`), code + under Apache-2.0 (`LICENSE-CODE`, `LICENSE`); see also `NOTICES.md`, `ANTI_ENCLOSURE.md`. +- SPDX SBOM produced as a workflow artifact by `sbom.yml` per commit. + +## Evidence + +- There is no `evidence/` directory; test vectors live under `specs/*/vectors/`. +- Signed Spark bundles: `aien-dev/aien-receipts` at `aien-protocols/<sha>/bundle.json` (workflow + path). Receipts are append-only and never edited. diff --git a/Cargo.lock b/Cargo.lock index f86df5d..65ca721 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -345,9 +345,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.7.5" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a52aa3fcda4e6302a9f48734f234d35d4721b96f8fe07d073f07ce9df4f0271" +checksum = "9c035cb64cba03dad2fb921f3e218785e8cf9a41790da5eb3a1400f62fa2be11" dependencies = [ "cpubits", "ctutils", @@ -382,9 +382,9 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.4.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" +checksum = "fe3e9d21d39e6f39ff46e03d5b621424f88ee23d8a1672c6bfc9ccc7f2da4f6a" dependencies = [ "cmov", "subtle", @@ -477,7 +477,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1086,7 +1086,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1233,9 +1233,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.15" +version = "0.103.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" +checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281" dependencies = [ "ring", "rustls-pki-types", @@ -1542,9 +1542,9 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "tokio" -version = "1.53.1" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ "bytes", "libc", @@ -1796,9 +1796,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" +checksum = "f5f280bbb2b287bc8e7de7e3852945a0ff50d1bbcb5ed42b6c7a568c546df171" dependencies = [ "rustls-pki-types", ] diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..ea21e25 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,52 @@ +# Security policy + +## Reporting a vulnerability + +Report privately. Do not open a public issue, pull request or discussion about it. + +1. GitHub: open this repository's Security tab and choose "Report a vulnerability". This + creates a private advisory that only the maintainers can see. If that option is not shown, + private vulnerability reporting has not been enabled for this repository yet; use email. +2. Email: drake@aienos.com with the subject `[aien-protocols-mv] security report`. + +Include the commit or release you tested, the component (path), steps to reproduce, and what an +attacker gains. If the report involves a secret, say where it was exposed and do not send the +secret itself. Encrypted mail is not required; do not post proof-of-concept payloads publicly. + +## Response targets + +This project has one maintainer; the targets below are best effort and stated honestly. + +- Acknowledgement: within 3 working days. +- Triage and severity: within 7 days of acknowledgement. +- Fix or mitigation for confirmed issues: aim for 30 days for high and critical, 90 days + otherwise, with a status update at least every 14 days until closed. +- Disclosure: coordinated. An advisory is published with credit (unless you ask otherwise) + once the fix is on the default branch. Default embargo 90 days, negotiable. + +## Scope + +In scope: + +- Specification flaws that let a conforming reader accept a forged or ambiguous input: signed + OSC unit artifacts, VC1 encoding and resolve, TRN1 transcripts, PST1 headers, CRB1 records. +- The C checkers and generators in `specs/*/tools/` and the vectors they check. +- The reference crates in `crates/`, especially `aien-provenance` (digests, Merkle trees, + signature checks), `aien-action-protocol` (capability grants, confinement authorization) and + the `SourceGrant` digest and P-256 signature. +- `tests/gates/run.sh`, `.aien/`, `.github/workflows/`. + +Out of scope: implementations that live with their owners (omega-mv, aienux, +aien-sovereign-core-mv); report those to the owning repository. The Spark test judge itself +(`aien-test`, in aien-sovereign-core-mv). + +## Supported versions + +Only the default branch `main`. The README names no release; `CHANGELOG.md` records a `v0.1.0` +tag (2026-09-23) that is not maintained separately. Fixes land on the default branch only. + +## Status + +Research grade, pre-alpha. One specification is frozen, one is stable, the rest are drafts. There +is no certification and no bug bounty. See AUDIT_SCOPE.md for what to review and how to build and +test it.