ai-trust, proof-of-ai, verifiable-data: the trust chain of an AI result, the AIP-23 envelope of an agent action, and a dataset whose answers are checkable without the data

ai-trust/ links six existing proofs (agent identity, model artifact attestation, host runtime record, policy and signed ledger,
Proof of AI envelope, on-chain witness) into one bundle judged by one verifier that checks only the links; 13/13 in the lab,
16/16 live on testnet 28001 (ledger head notarized). proof-of-ai/ is the AIP-23 envelope builder it uses. verifiable-data/
publishes append-only versions with an RFC 9162 root and a sorted index per field, range and equality queries proven correct
and complete, selective disclosure per field, availability by sampling, and the AIP-23 data envelope notarized (version 2 on
testnet 28001). agents/agent-ancora.mjs gains notarizeEnvelope({kind}), the general form of notarizeHead. Each README says what
is not built: zero-knowledge queries need a prover and are not here. No third party has reviewed any of this.
This commit is contained in:
Aere Network committed 2026-10-02 11:28:14 +03:00
1 parent f84a5e8c18
commit cf8c56792f
18 files changed
+1624 -3

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
# AERE AI Trust Chain
Trust infrastructure for an AI result, built only from pieces that already exist and are verified on their own: the agent's
post-quantum identity, the attestation of the model artifact, the host's runtime record, the agent's policy and signed ledger, the
Proof of AI envelope of the output, and the chain as the witness of time. This component adds **no new proof**: it adds the
**links** between those proofs, in one bundle, judged by one verifier that calls the existing verifiers and checks only that the
digests, the identities and the times agree.
| facet | what proves it | the link checked here |
|---|---|---|
| identity | `agents/` (agentId derived from an ML-DSA-65 key) | the ledger, the bundle and the output name the id the key derives |
| version | Proof of Software attestation of the model artifact (hybrid signature) | the output's `model.weightsSha256` is an artifact of the attestation; the version labels agree |
| runtime | the verify-layer sidecar's `runtime` record in its audit log (chain, head) | the host ran that same artifact (`matches`), before the output; the record is an entry of an intact log that continues the attested head |
| permissions | the agent's policy and ledger (`agents/`) | the ledger verifies; an **allowed** entry links the output by its provenance hash; the entry's time matches the output's |
| provenance | the Proof of AI envelope (AIP-23; digests only) | the envelope verifies with the AIP-23 reference verifier; notarized, its finality is read under a post-quantum certified anchor |
| witness | the ledger head notarized on Aere (`agents/agent-ancora.mjs`) | the heads read back through the reference verifier become the ledger's time anchors; without them every time is the key holder's statement |
Verdict: `VALID` when every present level PASSED **and** the witness PASSED; `INVALID` when a level FAILED; `PARTIAL` otherwise
(an UNMEASURED level, or no witness). Every level reports what it rests on. A verdict says that the bytes link and who vouches for
each link. It does not say the model is good, the host is honest, or the output is true.
```
import { construieste, verifica } from './lant-de-incredere.mjs';
const bundle = construieste({ ledger, policy: { policy, policyHash }, proofOfAi, software: { attestation }, runtime: { record, auditLog, head }, witness: { heads: [notarizedHead], chainId: 28001 } });
const v = await verifica(bundle, { rpc: 'https://testnet-rpc.aere.network', chain: 28001 }); // rpc: only for notarized pieces
```
## What it is not
- Not an attestation of execution in a TEE: the runtime record is the **host's declaration**, as the sidecar says; what is checkable
without trusting the host is that the declaration was made before the output and sits in a history published outside the host.
- Not a judgement of the signer of the model attestation: who holds the signing keys is `pos.mjs verify --signer`'s question.
- Not a judgement of the content: prompts, inputs and outputs are digests; the verifier proves that bytes with these hashes were
named, not what they say.
## Probes
```
AERE_VERIFY_PROOF=<verify-proof.mjs from aere-node> node proba-lant-de-incredere.mjs # no network: 13 rows (the chain, then every link broken on purpose)
AERE_VERIFY_PROOF=... node proba-lant-de-incredere.mjs --control-negativ # 8 plantings in a copy of the verifier; each must turn its fixture red
AERE_VERIFY_PROOF=... AERE_NOTARY_KEY_FILE=<key> AERE_ETHERS_DIR=<dir with node_modules/ethers> node proba-lant-de-incredere.mjs --viu
# plus the witness on testnet 28001 (a notarization paid with a test key)
```
The probes use the real children beside this component: the verify-layer sidecar (record, attest-head), the agents (ledger, policy,
anchor), proof-of-ai, and the AIP-23 reference verifier named by `AERE_VERIFY_PROOF` (without it the probe exits 2, NEMASURAT). The
model artifact and its Proof of Software attestation are a committed fixture (`fixturi/`: 4 KB of random bytes attested with
laboratory keys by `pos.mjs`, which is not part of this component; the digest is recomputed from the bytes, never read from the
attestation). `--viu` writes its evidence in `dovezi/`.
@@ -0,0 +1,269 @@
{
"bundle": {
"format": "aere-ai-trust-chain-1",
"createdAt": "2026-10-02T05:18:59.202Z",
"identity": {
"agentId": "aere-agent:965ac8dd3578bd4c32289394319a516b5f513947",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIHsjALBglghkgBZQMEAxIDggehAM549FJ8JaP9xfUWtr8m03ddBI0WBDTNZvgx\ndgFFZD5kVj+eB895lzRDN+naS0PmRsTKjqhH7F2FhissOBbrvvAyfzjqkGCWi3Jm\nqSPM5154djoN6Xh1jLUr0VYk50HGRMOHZfwAhYXoOYHpBswRs35Ld6k4UbsWhBiw\nqR02+xyNFLv5cW9QBBJdZOMh33rpqzNJV7Wwzl33qjpRS2je4VciAivx92ELI/72\nHFMFfVCpWuUl+3PPoFM1YMTsjgaUypYvK2gB3jw2pB3g+/KSRR08zLCD3SILdwYW\nlnp7V+f9ko5IT+1eTDGmZCqGRf2vlMnZiXOO/WqPMryPfC7erVbq8DsQimviURc6\nQxB5TM2+qQRRbB7MWJvkLuc5/2qs0kzHQ+NF57MTNXDsPBOGsSKvvGtwUlqiIYnO\nu2f1yhNni4HNcdC0uy7ohwnJAzxuZKuHQaNeTl9PgPoJ16Uu61ebFE7vOBOCvPvC\n6rtnmx0q8HqwduWfLKRSuUx82a2bZRr5Z31Jg0onLZS57sQzn6P3Q9wXSoq9VOzq\nDdFmg5ydH2h9wFBrw9Lm8hkabPjZt39cI3nGW3sn9NoJuPcFWfRsSTo1ndC25bHF\nPcoBz1WEkfw7hU3uMuhVuO1F2vw1NvFsnozgUXqcdf3KRcRRL/nInYkt+HFC8VDX\ni7q4J8V32EU3jdRvcgXlrf7g0PPkw5nCACpVUwUfb/PXs9+FunlRppR59146Unpm\naQlZgdN/9Ax5dKK7grcp7puz617D7l3wYg8RjNgRloEWkZ2Qt1g8l3MWYftvB3jF\nROC/gz8uPp8hMd7qtBSL9mMKDYvQ7yAdiYkJBzLXAyzKCP5oJkutUQHHqT5tkyrb\n6Qwr5PjFE/j0nbR2agqYLyKW/13dwUXV9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vZOiKfOOq+cXtI\nl4I5VlWDCh/H33jaHYsnX0HMDbNF0R7K7rCWQzAoR7rC4a8EDAvabyR3m4koiatz\nthHUVYMbpUD3m2MBFBBV7WObShXy4xkaJ37+LDQTsJ6MNpiv4Pbi/wrDHiPSNXWl\ne4E8ZzSXGyZJYSKu7jWQUdZR9v7IsykngtEGTR9stWiMlgyPZrTRO35aH3thVWti\nvm6Dgu+/FMSRAcuU0vUuD0UG/q4Wk6o3T4mQsu5DdAvwPc/IdZ/bwow0cWlnbE7H\n/IEGNe5RpI6EPtI189ADE1JTVnNZGGz9Px66bbcjHcG+B8QtLX6OH3IroHo6vfsT\nz3ae6+V9BdmrtKlKoxjAB5MCuZaluafFe2nJHAalS6XRfRD/YRr+8O52kI/h19lm\nWbwzBg0zgUtcpcAxyyVp8fvWznqjizWKIfTTqM1lWWMFVIkA0sIa5cm7I9mjOk6J\nXqwQ1kpDRc7pm4X0r1LE189V0iNpCzaquUMgObXXfnuLeQdM7Nl9iwEhnGLwuK3B\nCk+rsWyw8vOOpk5i7SU5186RsnNJZhtQATeZZnr8v1HYB2rTWzPmM6Kv9ArvbUWX\nzQp/vDDyO6CZV8G9uRVIfMph1dlo+KRB1/bCaOx7VZ4Ychx8R9+0CpwmSj2uJSLb\nr4bN7MGD\n-----END PUBLIC KEY-----\n"
},
"permissions": {
"policy": {
"v": 1,
"kind": "aere-agent-policy",
"agentId": "aere-agent:965ac8dd3578bd4c32289394319a516b5f513947",
"spend": null,
"tools": [
"model:aere-model-proba"
],
"recipients": null
},
"policyHash": "0x5040392a96c4f93295031ecc408d40b2ab717df5d6a8031d915377900bf06b76",
"ledger": {
"version": "aere-agent-ledger/2 (2026-09-29)",
"agentId": "aere-agent:965ac8dd3578bd4c32289394319a516b5f513947",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIHsjALBglghkgBZQMEAxIDggehAM549FJ8JaP9xfUWtr8m03ddBI0WBDTNZvgx\ndgFFZD5kVj+eB895lzRDN+naS0Pm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ti\nvm6Dgu+/FMSRAcuU0vUuD0UG/q4Wk6o3T4mQsu5DdAvwPc/IdZ/bwow0cWlnbE7H\n/IEGNe5RpI6EPtI189ADE1JTVnNZGGz9Px66bbcjHcG+B8QtLX6OH3IroHo6vfsT\nz3ae6+V9BdmrtKlKoxjAB5MCuZaluafFe2nJHAalS6XRfRD/YRr+8O52kI/h19lm\nWbwzBg0zgUtcpcAxyyVp8fvWznqjizWKIfTTqM1lWWMFVIkA0sIa5cm7I9mjOk6J\nXqwQ1kpDRc7pm4X0r1LE189V0iNpCzaquUMgObXXfnuLeQdM7Nl9iwEhnGLwuK3B\nCk+rsWyw8vOOpk5i7SU5186RsnNJZhtQATeZZnr8v1HYB2rTWzPmM6Kv9ArvbUWX\nzQp/vDDyO6CZV8G9uRVIfMph1dlo+KRB1/bCaOx7VZ4Ychx8R9+0CpwmSj2uJSLb\nr4bN7MGD\n-----END PUBLIC KEY-----\n",
"policyHash": "0x5040392a96c4f93295031ecc408d40b2ab717df5d6a8031d915377900bf06b76",
"session": "08bdf8fc04fba02a829bc11220a86e40",
"entries": [
{
"seq": 0,
"prev": "0000000000000000000000000000000000000000000000000000000000000000",
"body": {
"v": 2,
"agentId": "aere-agent:965ac8dd3578bd4c32289394319a516b5f513947",
"policyHash": "0x5040392a96c4f93295031ecc408d40b2ab717df5d6a8031d915377900bf06b76",
"session": "08bdf8fc04fba02a829bc11220a86e40",
"at": 1790918267,
"action": {
"kind": "tool",
"tool": "model:aere-model-proba",
"args": {
"promptHash": "0x1ed19f00c605cc860b3f375197b2c94d03d99a81c15d949294f8417d9edd1f93"
},
"at": 1790918267
},
"decision": {
"allowed": true,
"reason": "tool allowed"
},
"provenance": "b31b4582c8ee4caab3587b80378f8e7ef0345328b9616b046b5ac0c7af35bcee",
"seq": 0
},
"signature": "wAYJvunP2AyU67KhPyK7hbQfvKsfddNemyvWXw5I8MqOJSwy/ZfDXWQCHRe9GnuAgh6LJUrm3l2KpgAuiezR4HV+Ko9gSz+3Kue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d842b9eaec595f108ec221bcfff3cf14104a0e4dcb"
}
]
},
"revocations": []
},
"provenance": {
"proofOfAi": {
"v": 1,
"kind": "aere-proof-of-ai-attestation",
"statement": {
"v": 1,
"kind": "aere-proof-of-ai",
"model": {
"name": "aere-model-proba",
"version": "1.0.0",
"weightsSha256": "0xd0ce419be4152cc92aaf23799d6551044e286057bf9583032e4277317c742d1b"
},
"promptHash": "0x1ed19f00c605cc860b3f375197b2c94d03d99a81c15d949294f8417d9edd1f93",
"inputHash": "0x101246d82b1883367c721f286b66a06272464e9de4a6b3c76818ea4f22dad2cb",
"outputHash": "0xd49920d0712d4c9ead9845329b4c921c5423fa71330c464363690d352b273e3c",
"tools": [
"model:aere-model-proba"
],
"agentId": "aere-agent:965ac8dd3578bd4c32289394319a516b5f513947",
"requesterHash": "0x9bba5c53a0545e0c80184b946153c9f58387e3bd1d4ee35740f29ac2e718b019",
"createdAt": "2026-10-02T05:17:47.000Z"
},
"statementHash": "0xbf61d868ca971d865fd0ee807439b77f2456ef7a4cd0b56e6abf4bdb4185c196"
}
},
"version": {
"attestation": {
"v": 1,
"kind": "aere-proof-of-software-attestation",
"statement": {
"v": 1,
"kind": "aere-proof-of-software",
"tool": "aere-proof-of-software/1.5.0",
"subject": {
"name": "aere-model-proba",
"version": "1.0.0"
},
"artifacts": [
{
"name": "model-weights.bin",
"sha256": "0xd0ce419be4152cc92aaf23799d6551044e286057bf9583032e4277317c742d1b",
"bytes": 4096
}
],
"sbom": null,
"source": null,
"builder": {
"platform": "win32/x64",
"node": "v24.14.1"
},
"createdAt": "2026-10-02T05:18:47.385Z"
},
"statementHash": "0x2054e2817854b8b600079cde2041b07f459b332784a56dfc744ea09f041507c7",
"signature": {
"v": 1,
"kind": "aere-hybrid-signature",
"alg": "secp256k1+ml-dsa-65",
"hash": "sha256",
"messageHash": "0x2054e2817854b8b600079cde2041b07f459b332784a56dfc744ea09f041507c7",
"toSign": "0xf29da105e3cb554c05d79eeb5b710ac763cf91b7cbd7ab719cf35ea0bb812a70",
"classicalPublicKey": "0x02fb216d6425b1639575de6b318a2208735e855017d69e2d0ce8b19651adc0b4a3",
"classicalSignature": "0x2f97f740add016e61a5a4bd25221922beb3cf00ca2660506a865a4cc5a91538175dcf4c1cf9162f3bd78b0b84fd4f9f8d2817c9cc4a80d8026991003441dcf94",
"pqPublicKey": "0x72b4db6f419f2ae35f60b12d22252ddc49f5746d5187a91a27f1553043324844cef20b04a78d2612e77e2c4663215851e34b5a9142bafa9f459eae8795d2ca7b103c956ae1e6b87547b32fcd0e741daef9f4dd878a1a2ecb04624d499900b9718eb5b91d1d295f53e8ee793e21962fcd13eada511cb75fe5c42d3a1d72ea1ba99d727f26502b3259b9d8c29d487b47f3dc9711adc425897c01be4f20c01d99da3b36bffa28ef5dec0984b052cbb1db728686669313e02e42c3b844a2eba0bbbca79faaccab686014c8bfebaf37b1ee2285db9111be069d858ca5e14198c42067380add6f282a4b4701a1390f7ca5b69e62817f41c44961a70496ed1b8fb4283d4f05d59e8ce0293237d115e1269d3b73815b7bc67d52e7c55a550722eba20ee63c4c04256080c915f9a4f7e0e0a790322b371e50c9992deeb22a329e25986fd2ecd61125465f04d23f9a13aa786e453d932d0339bf3f0951d652d1d652de4b2ac3aed28d22a36371a65a27ad254f9435519c15e4b63a28b1f73eb4810cbf83a575d23aae1470c6ccb37b1095033d06ce050a200aead03bd5b36157755cfb33ee104bea6e1118ad730f817038f0abd78b460b922f6ff508f0ec84035988bdc3de5c7b5e3f29986d750ae9c07dd74aae47b48cd9c2cd875d0a9d36b0caa857ad3e74928fd6ecc57fc3a98edc9aa68fcf902f8b6d28b631b79f7cd24efb0f351072027d0bcd0018f93d84e7460e42e6cd1d7b9f4859b8030dd55774271bfccd38372db7a8181ca60a14d1f998e7ee2e190a0bd95a3251712460adc915175dce10c3399df069c05f74a7ae1d6e009bff2810598506d09df508517a0c800f135b3a06d96c7a2bd94c77aa44d6e5d7f74768cf6730f046b8ecf60ef499738e7acd676d6122968cd18956185dbdd965ed199650de4fc5bf96a2cd5f0bd1e0e721223d4def12241714961c806c131b283d0697ca4966d4460e5eeb0a92b3373a8efba2ed303db7f107c597cfa97c1ce0535a4278e09dd365c82e8587573c94eb3a66c057a5ed2751dfc4f9c68823992aed6543e4abb25b6ba423b5bc423cd1068be6149467ef03a3d156c0838aa6584c07620a7d9a0b9c2c3bc4365873e3051009d8e0b3159c9eb437d13c757eb3f77ed2e82eb1fbc2530ffe09d0e57d4f3c720f46517512a12a2fe7185f3d7ad4416ff1f115c39e6da0653850f285294d8175f2f13964c8e03086d8cdedfd264b12dceb3a7695781bfb1a9102cb9abf1a367abfcf3024e923eba458bbc72e5928bd71d4afa1768698617c552ba034c5deee00e76f7af3d9a8e06b2c60e4562a83dec816ce902bcc70a7cd6b35d7ddc68d4e322a215ecf0df3930107a2c7cd334a2ea14e7ebe73b685973998852ee4f7d6781fbe49fa3a27353b15a0380db2f3252f2c57de907b2454211dc7a6d364429c0737a05c53911f7d8af8852e1a289f02229ad2906d1758a65002fc0d31e2f46b177297bbedaa8d00d74f66a6689d958adb5aa2f816f7f785d1b0037303ba4d9c14eb358465d3c280a078af64df6bd5dfb5d61c4cad4ed1be8eb42589e6854f23a8f9d58825438001cfded789076fd108e7aecc6f334beb1b0cad4d091bc09c69ed312bf1abd55666b9e6e7fce1b308539a8f3ae4c59cd706fad2c2c533892028a105c266ae0ed1da5f96e1aa6a95f3b88f9a5a141d6c2c7d0fa89f0fd4c2da1e96cc9cd9a53135abb1f2aeb1fff061664e5c22338272c3d8e66b67cec4de3ccda1baabcd1639dc188d914cce1eac8c81989477de3cb5a31a38ac8276ffe5ca3f1aa91db55fd3da2a1e679735ade7f542bf5d9f6277b9ef34f7176bdd6713e2fe2b7b8d58bbd4a59f7c7a20936b54b9ea720a3d3f0bfb6cfd7d67520157d865e51fe2e9bbe53717b4e429198459fa2c4f6aa1ee95eaf2a52841df1bee67481871757864466832c4ecfa2e52efbd62371d4756b940abc396f1d15efcf0eb74e82469496d39d56b3db071bf5ae517a2699db269c18f703aa461f08cf7166497eca142c6ec64013381cdaff628e540f384f416d0707bc372de592dbf9365676f747a3a0410627e6fc135f595012c5409ab002160eb61d3b9fafd044f16e05e583341bf672b5c62ab4747a2c9ac9d4637c6e35cf8308d50958ca329da06d2e2b761efa916cf79b57b2d9017d2f4e434b0420989f4742aaa44006a9cab3c7e78144d26f73b5f2a3b72853bf5163d90e53ab59e7692a642ace65e24013d568248cf3a4a1b2fdb2fc5b9c8f2633ae625ff05d2a95f59dfbab30a07000fed589e81d5c9570ec00e2c710a5f6c2fef9a41e833b314366bd8d40c2838c46a2554bfcbbccd244a97df36020989d79769bebc0121764a1a2a9e148815fa724776daeb1e09dc60305df192870c7d30f37c07529fad5340b00c31207fe3ccc2bf988cef1626195ea50c9edcf533ab3ae6cf6c3dfb06e021936319bee8d95555bbee413fbd923990d77877de4eb310b7e4fe448202e0ac532b24db5da05f404a61b885a12d9701db80facf42beaa06dfbe2fbd44d86ae772cb34595b21d4fdae659a61344b38decd2c949a837923fd7708c14236210abed998b06e013163a1c505f6fa0d3d883277c19d7eacb199bb81ceccab2c1c984fae7c408238f54d03dff3c27db2b44c02d3a96a0cc880c4e54321af7b8ea7b787b3657a3a8b40d851614f1ab9dcff17b561303181eb1a03d879977eecd0b2d8dfe519d8fc31c746294ad979689102818084732b7d37c1a1",
"pqSignature": "0x7a0f9915556471cc7b2719794367459c24f3b00329d43be64d57f9bedca5cda49ae10b45f36de74799d78e20215765615410be1b5373f740b2311ae26ecec0286ef62c84bcb6d3f3e228f1f4914dfb4d0454aafc09c27f95b8d44c4906523e11ca484f97af0d0060cf3470141b887b0c24186e1dd9973779de79ec9c28f47ca370cb4726a5577b55e548f5f99812c29efba78160dcc7444d268fa41ed2499ca787dff8587868b13aa95d6b3ff48d74dcfd8a81d78c21a012cb2a9e79505f4653a5d604c3e48998a73a979bfd4b3da266844905abfa74b5525c32f46d08aa88489c3f84fb2b3fc9bf6a95a5b3ad61719f027abcfa55b6f9b17a49db540b44fe4cf4a9f46e275e218da4d456e64cfff8cc40a893e5c312cf9d7f91cbfbced1f8d1d5f732a3dce8e045dd3fac19a3f009050a59ccf5ae0fea669f40f2115d1089e78b30fa21cd457f9d5008f4803074da5724e5d7e888706d8d8e638f1552c6d93d5b1ede02f603b1d7a4c25d980e88ea3d1183fcd4af233ad51ad42ac20eceb2e579a28eb31ef43cb3ef37433e645c2621380a0fd731065f36fadb53850e7708bcc4bb700eadedbf2665dbfeb7fa6f182db18058b3887dc78cbde72cfea5e0fbc69571fdb4f1a81e83f601fc11f34b2378dd7a5d39325654fd202b890adf8b172e997a575a07454f95a7612b026e93c223b2aba2ea88d491a8cb5701b3688a46696b994b3ad665771c208be8d58646f28be2aaaadfb4c577dd7dde53620aab4d19676f5bee1634bd658af388f7b1b20e5fe0fca241395b14adfca0254f936c1807e9032af3718d4490b6d54beaea77f5e78b0509f15a659cbc5cfd84970fbd02d6342ed4047abe21a030af11558566b830f13540ff68f36bc85868ec33e86022e8fd5f8512386ae17d7bbd4d27c27ab2fe9ed160e802fa36db6d5f2e84a02b3c874cef27c2aae972406a79de6763ce5d04fbdf7712da16ecf5c20427fe5bee1be3d70ec276af0ef43c7fe13c64b5531ad79e556cc4bf1d64b74e5f87d3d05c04fd17f8e5a6d6b29277778a73c7c42e9d0ce73e8dc3fc865ace955b6d9f694ae4c3a7e051e9ab68c7b91e5214d71fdd1956ea2fe8136f40e0a2849d222014c14c22b83f1cc4a2deb00904ddb6483a278f8d8e8a8edd3d12451da4098a44d8e4c79155d8818895478d3ee7a0857b2971a56266265f6b38b5affb9d878c75ecb7c4541ac7c9bb01d8030c9b057ad3ed5877137c34fbcb23cce4c7bca5aa7ce10ac3a92416b972dea33c21cc49439f2b50650576fd3bca128da6053c5f5703d7107106e05a87e97a08a03cf28ea81dcbd713e71f0ef4b4285ec88029f8937e84607598e45a518d5bb95ba47a9e48ac0139fc76c7f6d9f0134c86749c5458ed59cebbe2fbad50a60a890eec6b3ab449eb17e2d02a3308633a9310f9aa25c54bb181bb298d25367851794dad6c4c25efe8598b1e718371d16e9b89a23b8ba8f31b2da54ae7f9cdfde9328e045f85a395950d24a4d48841d317564d9c06df9a70e95efae8f218c3b63ce42510caa93605b0e63b7434b1eb96db22df88fccb40da7652382ab0f24eec598d96b0915acfaaa0a6be242da6bc242f934920de333251e1a1c217734435879e24271fcd162e317a6f926434ed2a121793eb704c208fcfe0cc165d5a00e81a526cb25dbc0e65984bd74ec6a94911ca94e1903abc638879ed006928a47f36dcfcef6857e938c65906f2d6949208ebbfd351c3142d47f8ccf31b988a6735df449e30c38788c55fa274a59cb045cd99592ea4c9e17f175db2d84e9582dd40cbd81ef7ca510eed3b40da7ce62a2269bfbd3a9d3ff6dd379dcd73eccffcb1061d038b3e9807002e51cb32d912f8e7e3d5b9dc050584c2f61e8257daa0abc88c732ac8cd0081cf14f9f21041e4bd593d0b13d63aa5d1af95c8a421303d5b89b5af1c8d3b274f188b0530a398f09fd2048852295b115a0bd58c0c996cfb62dd8874566e5e3c252743a842111d3adc3d49d9c3d381fc0ecccc19e8429d96f02244c79be7171bda8ed836331657794beba1f863c0818eb8468e4e0864fd17b2ec4c910df9e016e75e589881684bbd5aedb309ca0e67d4f5902201625b6407eae56599c61c4c18fda2f1debff684ffb26e0a88808891a09943bc96a93ce540dfceed9969af0316beeb75084a790e69be50a046daa03ffdf69f05ed07296da1325293341d987d455eb60b2067dc4e264b4bf7fa47e7f081cb10e97f13d5f3ecae20812ac4f6c83f15dffb4d011335073fb6bf3c936d27dc6c789b6f4c3881f88365b402cf110eb20d664ed5fa66e8d520113e1b320f17068017694cd6cd85ad6075d6aa9e95f8a9b5aef03295425a2ffeeb852458f26536597da2b003824011054662896649496305f0c1e99f1c08948c70c7083dabacb94d57c587906c15cd03e52916a235fd515ba5ad325e8290148926aec6a40a6b132c2de7f02b81527fadb8de5bd4390e83fe36e0f09b7072380cf05d93508c877ea95760d405e925ac54ba239140f74edc4debd28bc6eb20d310153a17baac946db25776dafe491bac594d1732a5c339e0a0e2a2bed5e77fb536807ace1abf2d60cc005ac0a8927f3824e58a33730b5b3c144788d1c3b89f2296dbb2bbca4f9150b3b13652f0d170017e312f995d86c717782f0120a8d31df1c9da16a8dff419676e91ea5bc22065e30a9794657fc2f107f4cda2af965dea3bf40f06fc9d2e97a9f3d825ff58696e9209ecbb773ccee9c284c839bbeb5f2d10a2284c17b4cc1c3c9160a73bef0fe1ce38d93218237653f14c3a761c491162a2a3351fde6068e5d94f35f7effed952f2a9cdba13cb1894154ae22ee59ed584eebf0898bc01d8d67de0d02a4e8a3507c36e1ba3f0e2014b9d707a5862dd44af253ecb3b26f79c0e8be04ca65fccf6351633618c43cf1e857e3e846e4479c6b49029e86d152d70b190bb3f2cb870526020f1f326d128cfe6dfe3912172f5db6347181b0b0a7ec1d9ae62cdbd04aaa8d98f5c59fc6c81f9cba363eb3f0d4fcf1139406173c065aebb77ab06862a1cf989c6e7e01f3e0686cf0ab683e5e5c5fd28c35a631b60655764efd1c4900e0ce154bfca4d2da9c2c0fbf1e9b3d3a8c631873789ae0828e227d872a501b63f83b8a9717d3954bc69262423046fc6a711cacab0df12fb5ddfb3f5579fd6c9949ce6b63f209bdcb669ae73d9f8f09f314029d76b223bd15e0120b6d14e26b8a5c74f69fe8908d51a0958a4d3692d95459d5384c773a21880eb6d4dc90fcab84b62b2cc66deade1b1a26e8d239c94e75781ee5e866181b2579a9b16186e67079bc35ed2bdb6c57e82e578fe3b37ad7f7983d47a49a5f0f82240fe92afdc5a7d17fe9062fe3454946952765b1cf8337691d715a9b4ce5c78be8fb0179eae49ea9fc488308d549bacd1b0d0577a2032117f02c62f12c3db1b67f8e0b0dc53eaa182676540f785267d44253acf60abd0be18b91972815b7aa80be6e20789daLine truncated
},
"notarization": null
},
"artifactName": null
},
"runtime": {
"record": {
"v": 1,
"kind": "aere-proof-of-runtime-attestation",
"statement": {
"v": 1,
"kind": "aere-proof-of-runtime",
"artifactSha256": "0xd0ce419be4152cc92aaf23799d6551044e286057bf9583032e4277317c742d1b",
"attestedSha256": "0xd0ce419be4152cc92aaf23799d6551044e286057bf9583032e4277317c742d1b",
"host": "lab-probe",
"matches": true,
"createdAt": "2026-10-02T05:16:47.000Z"
},
"statementHash": "0x43be8a42d60c487d5f31d4d45f05122aaab8aad7ef851e8a3df32d8469dc9fd8"
},
"auditLog": [
{
"seq": 0,
"prev": "0x0000000000000000000000000000000000000000000000000000000000000000",
"proof": {
"v": 1,
"kind": "aere-proof-of-runtime-attestation",
"statement": {
"v": 1,
"kind": "aere-proof-of-runtime",
"artifactSha256": "0xd0ce419be4152cc92aaf23799d6551044e286057bf9583032e4277317c742d1b",
"attestedSha256": "0xd0ce419be4152cc92aaf23799d6551044e286057bf9583032e4277317c742d1b",
"host": "lab-probe",
"matches": true,
"createdAt": "2026-10-02T05:16:47.000Z"
},
"statementHash": "0x43be8a42d60c487d5f31d4d45f05122aaab8aad7ef851e8a3df32d8469dc9fd8"
},
"hash": "0x191e053dd8a9362c1f7be1f9fd2ec91a6a3b39c49d1255e01c55f21f14ba52d5"
}
],
"head": {
"v": 1,
"kind": "aere-audit-head-attestation",
"statement": {
"v": 1,
"kind": "aere-audit-head",
"host": "lab-probe",
"count": 1,
"head": "0x191e053dd8a9362c1f7be1f9fd2ec91a6a3b39c49d1255e01c55f21f14ba52d5",
"createdAt": "2026-10-02T05:18:47.712Z"
},
"statementHash": "0x3df17b7cdc1197d45291c50b27ffe66c9b7317d66c7fa94589673886d07605fa"
}
},
"witness": {
"heads": [
{
"v": 1,
"kind": "aere-agent-ledger-head-attestation",
"statement": {
"v": 1,
"kind": "aere-agent-ledger-head",
"agentId": "aere-agent:965ac8dd3578bd4c32289394319a516b5f513947",
"session": "08bdf8fc04fba02a829bc11220a86e40",
"policyHash": "0x5040392a96c4f93295031ecc408d40b2ab717df5d6a8031d915377900bf06b76",
"seq": 0,
"hash": "bd9095330bb9b9bec67463d842b9eaec595f108ec221bcfff3cf14104a0e4dcb",
"createdAt": "2026-10-02T05:18:52.410Z"
},
"statementHash": "0x596f0fbc420a50a9289332a2c28a379f66b8a2d58fe4e5a458a98fb16db61e1a",
"notarization": {
"chainId": 28001,
"notary": "0x70099E62735500AA2F85B60C518551a57B202d54",
"firstSeen": 1790918334,
"txHash": "0x03a9151c4e6257f40548bb57b9173cc45677529302ce8666390f386e5100e9ca",
"block": 4383359
}
}
],
"chainId": 28001
}
},
"verdict": {
"verdict": "VALID",
"reason": null,
"levels": {
"form": "PASSED",
"identity": "PASSED",
"version": "PASSED",
"runtime": "PASSED",
"permissions": "PASSED",
"provenance": "PASSED",
"witness": "PASSED"
},
"details": {
"form": {
"state": "PASSED"
},
"identity": {
"state": "PASSED",
"detail": "aere-agent:965ac8dd3578bd4c32289394319a516b5f513947 (ML-DSA-65 key; the id is derived from the key, nobody can claim it without the key)"
},
"version": {
"state": "PASSED",
"detail": "model-weights.bin 0xd0ce419be4152cc9.. attested as [email protected]; signature UNMEASURED"
},
"runtime": {
"state": "PASSED",
"detail": "host lab-probe declared the artifact running at 2026-10-02T05:16:47.000Z; in the host's audit log (1 entries, chain intact); continues the attested head (count 1)"
},
"permissions": {
"state": "PASSED",
"detail": "entry seq 0 (tool model:aere-model-proba) allowed under policy 0x5040392a96c4..; 1 entries verified, revocations 0, time witnessed"
},
"provenance": {
"state": "PASSED",
"detail": "model [email protected], prompt 0x1ed19f00c6.., output 0xd49920d071.., tools [model:aere-model-proba], requester 0x9bba5c53a0..; signature ABSENT"
},
"witness": {
"state": "PASSED",
"detail": "1 anchor(s) from notarized heads under a post-quantum certified state: seq 0 first seen on chain 28001 at 2026-10-02T05:18:54.000Z"
}
},
"assumptions": {
"identity": [
"ML-DSA-65 unbroken; the agent key holder is the agent"
],
"version": [
"the attestation proves what its signing keys attested (who holds them is a separate judgement: pos.mjs verify --signer); the artifact digest is what links it to the output"
],
"runtime": [
"the runtime record is the HOST's declaration (the sidecar reads the export the operator makes); it proves what the host said ran, not that it did; the audit log has no key and is judged against a head published outside the host"
],
"permissions": [
"the policy given is the one pinned (its hash is recomputed); revocations come from the owner, outside the ledger, and only those given are judged"
],
"provenance": [
"digests only: the prompt, input, output and requester are proven to exist as the bytes whose hashes these are, not shown; the envelope's time is its producer's statement unless notarized"
],
"witness": [
"the time is the chain's (the notary records the block time; on 28001 and 2800 every validator is run by the Foundation): whoever notarizes can only notarize late"
]
},
"notice": "A verdict says that the bytes link and who vouches for each link. It does not say the model is good, the host is honest, or the output is true."
}
}
+45
View File
@@ -0,0 +1,45 @@
{
"v": 1,
"kind": "aere-proof-of-software-attestation",
"statement": {
"v": 1,
"kind": "aere-proof-of-software",
"tool": "aere-proof-of-software/1.5.0",
"subject": {
"name": "aere-model-proba",
"version": "1.0.0"
},
"artifacts": [
{
"name": "model-weights.bin",
"sha256": "0xa78f10b9b2926338085b0be951ed16ac1400b843e32c78fa5f844f5333afe647",
"bytes": 4096
}
],
"sbom": null,
"source": {
"commit": "03fdb26469b7353b002c490d5737195fa9e5d983",
"remote": "https://git.aere.network/aere-network/aerenew.git",
"dirty": true
},
"builder": {
"platform": "win32/x64",
"node": "v24.14.1"
},
"createdAt": "2026-10-02T05:28:15.365Z"
},
"statementHash": "0x8ca7931c4635405886e7ade1743bd188599517ba78af17991560aaaf516d6daa",
"signature": {
"v": 1,
"kind": "aere-hybrid-signature",
"alg": "secp256k1+ml-dsa-65",
"hash": "sha256",
"messageHash": "0x8ca7931c4635405886e7ade1743bd188599517ba78af17991560aaaf516d6daa",
"toSign": "0xf3d92e34ce3bd43e4ba1ade10d149a2756730ed9278832f7325febd18599b184",
"classicalPublicKey": "0x0342abaa1cf81e492f81802f03171a0bf7b01fe7b9a1b38c416f32419ee1138bca",
"classicalSignature": "0xc895ef477c760bdae2371b62e7134d5fbf190a7b13c60a4ca83f97d50c4dcfb95f51dee1e7f5073d216d1a11f40eb3d13e217676be804b9f44a8c1ab77beb0e1",
"pqPublicKey": "0xfce0947486089663afb7dd72b1edbb6874430065a43ba950b770b0cabf36d36ef394d32d2a49e487222639d5d30fe1254ab08736a64b91a86f6e888e603d3019657a20e99c4e139bc34373793956ac01c4c713b9eb899d16ee0de4ee08da5f1b45c5d3bf00cc593779310756dfa4f7268d08a5f05ef256eec821fbebb90b70eb15a309f04512aa281e8d1e0cb200a93eb911cc4f46737565d052df6e76469806488596ca9ecc51b4d5ce54c331e270071c9871f735de2438ee8cc190a5066c78dabba9e4aa8d44d271640f0d7a610ffba5051c7f9a0aa7ca8d3f485e4a2d7ccf3687844ef41be11c2f649fb35068910ce3eb676807d1d26fbe6a27710bbcd15e41bbff1e71353e1893a6107d5bb3011670cfea811db8cb9e59137a08344542c24e2bdeb8f90276ed31a5714ecee07d2d613e977a85ca610a57cbd4c3504e72d00e255de9b77947b9bd6ae2f937959a792e5b20fe3b7a72e26cee3c9603239f318213b4ab1c3346ae48501b1e903f3f7c8b95c0c6d93370060b6df69e785582af19201605bbb19102c08cbd534f08d6d2f443fa6ff820f9f8ffab836eb04bd35bc5ddb5690732abb483112e0d9a35ec69256ced270c3ae9a8a28239eadfa439f2753e8c838869dc9d79e47b1653aaecb99462befb0683f9d3ef321432af27bea85380044f20aa7f5e6b00b6b64ebba742b43ca903d2244955abe0c9fc99e23928de48ff2b3e822e9a93d4d39e4675fa3b516b166e6545ae4981ee3f957612a506105be9215c5c589083a96cec17521f84417ce26ab72c1f16c8165937f54393d6edaeda200fd55c2617d8fbbd7e35045ea810bba58bae0fe52d04b7ae1284b75e2c93fe2d62f181073dc1aff2100581fb8b6e6a8a485d5a063f1568f738e8e807275e1f13666839d6093cc06028d3345b8e50e680dd8ba52b024ebd3178590267aab5df06ec558bce697f1ef2e9721cb495b114e8fc8e181bd9cad47056d8af998d74c128bdb8a638621e1b0865e24a5fbfa02a43cecf07bda043e023b85db414d041ec743e9eb94d8ef9423cc66e9cf11d85ee48e9ec95738ddc285463ad07934a44e6a3562362344798c575652b127b9b1c8b653ea424621e4d2d37406f5ae4c27e076a775f86f67e89eb08e93f34037a74cb1e991b458505106b4188af8e9a4b453dadfee2efcae46b2df38cf72d0685a9676f8f047dadf9f53e66f634e4a51f6958afe736f258bbf2aaf33b4e337a2fdfacf74531a9ecd2d24b8892e42e23ad00ae9695f4d5437cb4b6f75ba17a90b25646d43e5e2a5b2abc3ebf09edd889c07e40c42d5d62cc449eefc2f093e05e9b9a14fa8b75cd6ffa50c367640a2f3aa4c196ec567ff4e087f2e784d4f1ccb9073dd73c34a531afd11de3621f0e65c131987dabe6a77005bd75ab9943f4abd3527b58fc1764520936a47432fae890885f68b0fd5ce18d6348453b4d06e9fb3058d4ed16dc160e8b3b2afb38f3c212d8f2b371cea3a6b3a112876430def86e37bfcd624a0ff01cab238be38be77bdb2944579a18b0ba4dfa13af740b6ef23c0a5a7052122694c503b6c4952d3f09322fd6bf5a5c3793d0a6a9ad6d8b041c120a05b5c7fbbac2abe70747e65dced88fc0797bef0543b3cbcbbc53663cef39a1c7f492a7082a41f767d3d36fd25feec9de8297f71b021b67d2c57790c4e288af7a34e960dc5cf917d85f671a2c8d47208bf9b2b268c80d90413c3b28148e63bd4ca8246e17759c268abd0053afa6a01bbae2f7fc08c4ca57c500e5d761ddd3e35c14409f8a9d382f135872c9871fb6dc2e7e2baa18e6e26c17ace046460a5bdc0c1a87b2056eaeff857b3e524100ee9439a92303574cedb13b094b7772a4c8d2c72c5f8eb89285846c63fdcb0d3ba36e31e515103a69be267e492207b1d4a53be3a6b34c1a5e5ecac4bf18a8a0790f02c834ebcf55da573f1fdb1e83db1870eae67280e58c6bf431e17b1977e07dec3fdcdf2823fd5dd81e739b3cf9da8d08d726735aa9e9ad817acf36576bf43abeacae23505327cb6e34147731c9e7c5d4ee12113acaceb5e34fc3c49191a4c14e01b6814345d54cea8243c6cc04c4a49777644c7ed0ec4bf6f0a1fee239678b680bdbcc261465bb44f6994e97600be5ea97a12dcfb5c52601895b93444f3d4e564eddad951095d01a282f17a75a66db88a920b4a52da15187ab84f7f7113031c1760496bdd0c719ac1fe5e87dd6013dc4342277219cca7eb3571ed7cecec4213e8365da3c7e7eba51bef04710430558096fa7dbb10d694d24a9fe5ce7f959dbded9563e52f1da362f242e4142a6c560fa4d270ca3e24c530920ef297b3fd447a985a51f61395ca908509cb184d16f41bbc0d505e5feab44636a6158a3457583ab146beadc0965ed9ed375f8d1145a36e1e38fd8f15638a8d86386cef4d4f4d69497a59474b2a3633b2dea0f325bb63c3da63dcbae9d0ba938bc96e7d0a52aab6a5380162d20a105c762c5e8ae7c876428a0662e5327f6f91780da728534e2df792dae13b78564b2128c7e40ceb1a302c93606510009e52e475898d4e6e738d248d202da1adeabfd50ad382423492301ad06827e1df730330391a0bb707883a86dc543c3f743da3d5aebff073e39fc4d1f60d298ab29bb45686a3101276c7745ae558b71e653fde828f0748b0f56b28f3a5b6ccc08548d23805d8177f7e50f4ea007223de88d685474231e2610cb822feea3dc711f0f18a28eae60c284f37a5598982b",
"pqSignature": "0x0a0bf11b4718451eb818dc27b12a4b8a9a319596804fe960c8fca557e15c4e31f5757b1a56dd93a446f11e6be18d38c72192e12e5ffeced90f0e4a7e8deddf983347b4834125696a18bc33d010ce10f54ccec944fa05fbd897f53519356a0387aa390816bd12702a74db62b4254bf229af453aff9036ea51da865092d54f6b4041a2e5d12217e88e79c1b699a0d0159292ffc528f6034a1176edbbae75fb9afb38c10b01ff40ce7d3890e930e534ed616753d44531f079c9a405971bb4a14a101f09893264ae908548ac381055283de0b17a9c0ac2a6d867bbf345df7e701f0afe5c1d028133eb9e9c8aec0ce667a5f4ab25037d5a9ae8ec476a6dda0ebbc5346e86d6e80ca429feef69cd1f52566e162268537a6717faabacfbc5a9a403ef95e8bf7b42e55afd58f7177aebe099a2839493c426dcd05d0961e158166585e2334a186648f80589ccd5b3cc5227ee243d0552823fe8560c6e5d91e26fbba887c1d971e8d3c0d11841b20b625e680b192bb0e145409f4ca92d53acde8e8f50e98be42f13fde1e26dff7a4412b76ed3d30026d04f1430c2e0e90b9bddb85239720ceb281c56613cbd11291be969ce032d91139315cc476596e86de24d8f61df46ca7d5dd202d52b0cc4c7fd0d0578a42e79c8f84f5c51363da2b9552c06cf3c853f6585c5a291550628eb162b18ae8026a946bd75a85bb2a021281546eb4175bd6ff257f2571f1e70d5aac32c1d6074ce743f08c195d626216540386d8cc612177cd9e72a9ba836724e5d64d1d0e87babbbef088011c58081e1f6089cf5bad11a84522c30d382cf93a558be4545bac9bd6b52922e87963ccf86443ef83b8d8382966d9da8f246b563c964d0f6ca36a229cd788f206327edddae0dcc19e577a7b3a10f4f50503cdfa1366e7ab1be279257f310da6bb2c148b420227212400e87e78d8d0e497abbb6c4fa6b1a6143d3e7885f290b40a5b49e1e0c4993d71f33508a5faea029045ca8df0086ec7146e5e0e3cfdea61a2b8f6df93e0ce3c12b2da6e613d5542c9f65098221aca3eb7263138494dea7b18d8a9ccab367314a6d140371a5fbc20e6277c5c39a46617139d19af3a487bb40c53a7f5d7b9451ef5e0ac82125f5c0d4408492480135cae2f18de09a4027ebe13bc0c6cb096dc79b28a6f24122e79452680fddcafe98c1c237d5e32478b39a5a2e3b1fb347d9fc50f5231348492fde8b30171c927d99c0757a83bdd89ca7ca3d7b1643ea1bb2663995017a2022f343e9377ed3699f37e67ec0b0d3bf304aad197536d28cf3902131e1ae02e6905cb8dbd0c6aa682a72f5919cd8d643c6eb7afcb24f9853e37adb57e8832c54e0ec03e487713c4ddab6d4c74e387c78f34760a5bd51967e5a9467eeb15ad1b62af7a0188000fc10227d06e39d570406496549bcbbdeb0c68509a23440ba812f24b65e6ae386c85e5c1ea7de3f9920d49764b0974e98676ccb5746218aa763722ff1c1bb6ef67e699ef7d6b1ef30efee6e319dd61c6c93a9b6b8f08909a75c514b3d4e3224e1b6f6aec86fc9e005efddf856e8aa5aad174afcb33142676f3f27dd268be850b46126082fd7674cd2a04ca4f39f558c5f31361334331b09cf836441c220083d45caae3f3fd329d1f4adac15157af2409f16926d8786f5f8ff768befa21263bdc27c3f29a1f4ca83f15329df798e42ffc494b19faa524d16cc1f620e44168d42f820d22bc98c82e841c606d92cddaaf417bc4e78926d7422e48851633f316c15a0247a3343a7ac089043fd0a86442659078e5d8d0ffb47d9a20faf51d4bbbf58493ac213fc1d0a816808aff161456ddc84c858c8b0b432c09299a69168dbe0f4df87c09bfd5d74d9b2624b105e7fe25780ccb25e78686cfb559a557a20d78d0f953e1f32eb33d2ca57a96a614743ca7c4b0b9a966f7b98a871b78adb50abc1c56e43a1b05a1daab91e7e8f49c37528bd77b961d4b653add1a01216e6a960d8881eefeb4c8cd684d04160f4b9465d1c88314484f47a74356d0f192c7fcc8bd73addcc15f438824adb8ee96d99897fa90b075328d82a6a2fb768cd6077a44396b908abf6428cd7cb122887147127af53c5582edacbdc3e58731436cede58b1721398123fd11d1f7f58d320dbadf763ddec89b202075079bc2745a4206f429c158cef4b985dc7c38b2c7b9a3eed147b273937ae078b4cecde16c77e1ec128f52e7579e6e5f9dc4aa5374f1540c57e5a67e9ed7d517d7756581fe3a80be91f8afc259dd30ab19cad8dad68346cbc17ca7448e3239bd531f60227e55d36f770e44c2b458172ce096d8e2cc29a1237c469c15bfed0bedf597e2766d97c6734ac641e62622cce3a4664d849d5f4f1e8e28d70eac0aabe23342bbad533454ddeb6b71e020837c75309f8237d33193836a10fce34a9f2e4465b028c7719382d1568f4349cdf27826c17fe26b79c76d3a433f75b125018c7315fc3912a11d8ce946963c9ac278e87d83e514d3a333ffabb0e646744aae0658071d703930d3a95f0c540f912dae981fa860d8d9979c7392f7ba94bb7f81cc7bcd7c7bf52317866fd89c5e2d8a181cff1d927874d18f45fb2edf871a0a471232a04e5c4c723a5776290be45c0aa49cf1ca01c7ff438735a2875d10a1a186b47f2adb34d050df91257c403a358b5358a1d56e7aca612f8b970fe477f3a78f9d647a73429070ae7c266c43f8030d0e4957adeb8be26786f015c51829517e2809588c7d199dde34cb7113e504778f94a2e1a91d9e93df052c32319e7c44bccaf697d2aebdb8bf67700ba3d12882d8bd8da4f0fd3a4978eeb3daaa047a538be33c970ac23264367dba05ecf4f55ad56cdcdf45e4e8dbd6c553da29a916995a556cd35438c895d18be1794d69948f51f9eb95e6d6d7f7bbe1c8d9c437e65147246c145067c0a723bebfd0b792609235675e9ae4d4f7282406114521e012d8df43d412ec65b605264be77149b9d835afa62e77ecbc60b80b0ec1b777ea14bbe761484bcf54df563923716350d6c5f215405c293c2470805e7fe917eb0b5bf16b722ee662a4503e531d660b576ec621937f36bafecc4814959546058b4658efc68655a213a1023484b77d662a2902f3d93928bf9f58176ba81ddefa406c55e622f7a1c03a460a023735990629821c92ecd97f9a82538d3f06ea06a2f00c3f71263bace271dff8be395c76ab5c4e5ea375847a837a6d6c4d5aa09e51d4f7917e284ec29a79b18c70438e073627a6a10b89fd0ca1a065b8e03de10ab63e26b7dd208b126728fbda80caf109a4fa3d7ac58b21f991bf28147406e20926c3a64f510360e433413fbaad41044623777ad24574358e77fa131b435aa8c274f4c3368e8b6c50e03f48545c7e9234008db43d646cb800eac876fff414d402c4e70191f7b558711bc273fb2a70c6a29d083c77934980925f0654beb70ca730148591cd5c43784558dd634c3c123c47d87896717e6f63746b9d6d0b84a98455ddba71dda6880fd2e890a7Line truncated
},
"notarization": null
}
Binary file not shown.
+213
View File
@@ -0,0 +1,213 @@
// lant-de-incredere.mjs - AERE AI Trust Chain (roadmap master point 21, track B, 2026-10-02): the LINKS between the six facets of
// trust in an AI result, each of which already exists as its own proof, joined into one bundle that one verifier judges:
// identity the agent's post-quantum identity (agents/: agentId derived from its ML-DSA-65 key)
// version what model ran: a Proof of Software attestation of the model artifact (weights or runtime), hybrid-signed
// runtime that it ran: the host's runtime record (verify-layer sidecar, kind runtime) in its audit log, before the output
// permissions that it was allowed: the agent's policy and signed ledger (agents/), the entry that links the output
// provenance what came out: the Proof of AI envelope (model, prompt, input, output, tools, agent, requester: digests only)
// witness when: the ledger head notarized on Aere, read under a post-quantum certified anchor (agents/agent-ancora.mjs)
// Nothing here re-implements a child verifier: every envelope is judged by the AIP-23 reference verifier (verify-proof.mjs), the
// ledger by verifyLedger, the audit log by the sidecar's own chain check. This module checks only the LINKS between them (equal
// digests, equal identities, the order of times) and reports each level in four states (PASSED, FAILED, UNMEASURED, ABSENT) with
// what it rests on. A verdict says that the bytes link and who vouches for each; it does not say the model is good, the host is
// honest, or the output is true.
// VALID every present level PASSED and the witness PASSED (a time somebody other than the agent fixed)
// INVALID a level FAILED
// PARTIAL otherwise (a level UNMEASURED, or no witness)
// Node.js 24 only; the children are in this repository (agents, verify-layer, proof-of-software, proof-of-ai, verify-proof.mjs).
import crypto from 'node:crypto';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { spawn } from 'node:child_process';
import { fileURLToPath } from 'node:url';
import { agentIdFromKey, verifyLedger, canonical } from '../agents/agent-ledger.mjs';
import { hashPolicy } from '../agents/agent-policy.mjs';
import { verificaJurnal, verificaFataDeCap } from '../verify-layer/sidecar.mjs';
import { anchorsFromNotarizedHeads } from '../agents/agent-ancora.mjs';
const AICI = path.dirname(fileURLToPath(import.meta.url));
export const FORMAT = 'aere-ai-trust-chain-1';
export const LEVELS = ['form', 'identity', 'version', 'runtime', 'permissions', 'provenance', 'witness'];
export const TOLERANCE_S = 300;
export const VERIFY_PROOF_DEFAULT = process.env.AERE_VERIFY_PROOF || path.resolve(AICI, '..', '..', 'verificator-falcon', 'verify-proof.mjs');
const H32 = /^0x[0-9a-f]{64}$/;
const sha = (b) => '0x' + crypto.createHash('sha256').update(b).digest('hex');
const lower = (x) => (typeof x === 'string' ? x.toLowerCase() : x);
const lvl = (state, extra = {}) => ({ state, ...extra });
/** the hash a ledger entry stores for its provenance: the ledger's sha over the canonical JSON (with or without 0x, both forms matched) */
export const provenanceHash = (envelope) => sha(Buffer.from(canonical(envelope), 'utf8'));
const sameHash = (a, b) => String(a || '').replace(/^0x/, '').toLowerCase() === String(b || '').replace(/^0x/, '').toLowerCase() && String(a || '').length > 0;
/** build the bundle from the pieces (files already parsed); the links are not computed here, the verifier recomputes them */
export function construieste({ ledger, policy, proofOfAi, software = null, runtime = null, witness = null, createdAt = new Date().toISOString() }) {
if (!ledger || !Array.isArray(ledger.entries) || !ledger.publicKeyPem || !ledger.agentId) throw new Error('a ledger (agent-ledger export) is required');
if (!policy) throw new Error('the policy is required');
if (!proofOfAi || !proofOfAi.statement || !H32.test(String(proofOfAi.statementHash || ''))) throw new Error('a Proof of AI envelope is required');
const b = {
format: FORMAT, createdAt,
identity: { agentId: ledger.agentId, publicKeyPem: ledger.publicKeyPem },
permissions: { policy: policy.policy || policy, policyHash: policy.policyHash || null, ledger, revocations: [] },
provenance: { proofOfAi },
version: software ? { attestation: software.attestation || software, artifactName: software.artifactName || null } : null,
runtime: runtime ? { record: runtime.record, auditLog: runtime.auditLog || null, head: runtime.head || null } : null,
witness: witness ? { heads: witness.heads || [], chainId: witness.chainId || null } : null,
};
if (policy.revocations) b.permissions.revocations = policy.revocations;
return b;
}
/** run the AIP-23 reference verifier on an envelope; returns its JSON (levels as a map) or null */
export function judecatorAip23(verifyProof, envelope, { rpc = null, chain = null } = {}) {
return new Promise((ok) => {
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'aere-ai-trust-')); const f = path.join(d, 'plic.json'); fs.writeFileSync(f, JSON.stringify(envelope));
const args = [verifyProof, f, '--json', ...(rpc ? ['--rpc', rpc] : []), ...(chain ? ['--chain', String(chain)] : [])];
const c = spawn(process.execPath, args); let out = '';
c.stdout.on('data', (x) => { out += x; }); c.stderr.on('data', () => {});
const t = setTimeout(() => c.kill(), 300000);
const gata = (j) => { clearTimeout(t); fs.rmSync(d, { recursive: true, force: true }); ok(j); };
c.on('error', () => gata(null));
c.on('close', () => { try { const j = JSON.parse(out); ok(gata({ verdict: j.verdict, levels: Object.fromEntries((j.levels || []).map((l) => [l.level, l])) })); } catch { gata(null); } });
});
}
const parsed = (j, name) => (j && j.levels && j.levels[name]) ? j.levels[name] : { state: 'UNMEASURED', detail: 'the reference verifier gave no ' + name + ' level' };
const envelopeOk = (j) => j && ['form', 'integrity'].every((n) => parsed(j, n).state === 'PASSED') && (parsed(j, 'signature').state !== 'FAILED');
export async function verifica(bundle, { verifyProof = VERIFY_PROOF_DEFAULT, rpc = null, chain = null, now = Math.floor(Date.now() / 1000) } = {}) {
const levels = Object.fromEntries(LEVELS.map((l) => [l, lvl('ABSENT')]));
const assumptions = {};
const fail = (l, reason, detail) => { levels[l] = lvl('FAILED', { reason, detail }); };
const unm = (l, reason, detail) => { levels[l] = lvl('UNMEASURED', { reason, detail }); };
// 1. form
const isObj = (x) => x !== null && typeof x === 'object' && !Array.isArray(x);
if (!isObj(bundle) || bundle.format !== FORMAT || !isObj(bundle.identity) || !isObj(bundle.permissions) || !isObj(bundle.provenance) || !isObj(bundle.permissions.ledger) || !isObj(bundle.provenance.proofOfAi)) {
fail('form', 'form', 'not an ' + FORMAT + ' bundle with identity, permissions.ledger and provenance.proofOfAi');
return verdict(levels, assumptions);
}
levels.form = lvl('PASSED');
const poa = bundle.provenance.proofOfAi, st = poa.statement || {}, ledger = bundle.permissions.ledger;
const outputAt = Math.floor(Date.parse(st.createdAt || '') / 1000);
// 2. identity: the id is derived from the key, and the ledger, the bundle and the output name the same agent
try {
const derived = agentIdFromKey(crypto.createPublicKey(bundle.identity.publicKeyPem));
const same = derived === bundle.identity.agentId && derived === ledger.agentId && derived === st.agentId /*PAZA:identity*/;
if (!same) fail('identity', 'identity-mismatch', `key derives ${derived}; bundle says ${bundle.identity.agentId}, ledger ${ledger.agentId}, output ${st.agentId}`);
else levels.identity = lvl('PASSED', { detail: `${derived} (ML-DSA-65 key; the id is derived from the key, nobody can claim it without the key)` });
} catch (e) { fail('identity', 'identity-key', 'the public key cannot be read: ' + String(e.message).slice(0, 80)); }
assumptions.identity = ['ML-DSA-65 unbroken; the agent key holder is the agent'];
// 3. version: the model artifact attested (Proof of Software), and the output names that very artifact
let attestedSha = null;
if (bundle.version && bundle.version.attestation) {
const att = bundle.version.attestation;
const j = await judecatorAip23(verifyProof, att, { rpc: att.notarization ? rpc : null, chain });
if (!j) unm('version', 'version-verifier', 'the AIP-23 reference verifier did not answer for the attestation');
else if (!envelopeOk(j)) fail('version', 'version-attestation', 'the Proof of Software attestation does not verify: ' + ['form', 'integrity', 'signature'].map((n) => n + ' ' + parsed(j, n).state).join(', '));
else {
const arts = (att.statement && att.statement.artifacts) || [];
const w = lower(st.model && st.model.weightsSha256);
const hit = arts.find((a) => lower(a.sha256) === w);
const ok = !!(w && hit) /*PAZA:version*/;
if (!w) unm('version', 'model-weights-not-named', 'the Proof of AI names no model.weightsSha256, so no artifact can be matched');
else if (!ok) fail('version', 'version-artifact-mismatch', `the output names model weights ${w.slice(0, 14)}.., the attestation covers ${arts.map((a) => a.name + ' ' + String(a.sha256).slice(0, 14) + '..').join(', ') || 'no artifact'}`);
else {
const v = att.statement.subject && att.statement.subject.version; const mv = st.model && st.model.version;
if (v && mv && String(v) !== String(mv)) fail('version', 'version-label-mismatch', `the output says model version ${mv}, the attestation ${v}`);
else { const h = hit || arts[0] || { name: '?', sha256: w }; attestedSha = lower(h.sha256); levels.version = lvl('PASSED', { detail: `${h.name} ${String(h.sha256).slice(0, 18)}.. attested as ${att.statement.subject ? att.statement.subject.name + '@' + att.statement.subject.version : '?'}; signature ${parsed(j, 'signature').state}${att.notarization ? ', finality ' + parsed(j, 'finality').state : ''}` }); }
}
}
assumptions.version = ['the attestation proves what its signing keys attested (who holds them is a separate judgement: pos.mjs verify --signer); the artifact digest is what links it to the output'];
}
// 4. runtime: the host declared that THIS artifact ran, in its audit log, before the output
if (bundle.runtime && bundle.runtime.record) {
const rec = bundle.runtime.record, rs = rec.statement || {};
const j = await judecatorAip23(verifyProof, rec, { rpc: rec.notarization ? rpc : null, chain });
if (!j) unm('runtime', 'runtime-verifier', 'the AIP-23 reference verifier did not answer for the runtime record');
else if (!envelopeOk(j) || rec.kind !== 'aere-proof-of-runtime-attestation') fail('runtime', 'runtime-record', 'the runtime record is not a verified aere-proof-of-runtime-attestation');
else {
const target = attestedSha || lower(st.model && st.model.weightsSha256);
const ok = !!(target && lower(rs.artifactSha256) === target && rs.matches === true) /*PAZA:runtime*/;
if (!target) unm('runtime', 'runtime-no-artifact', 'no attested artifact to match the runtime record against');
else if (!ok) fail('runtime', 'runtime-artifact-mismatch', `the host ran ${String(rs.artifactSha256).slice(0, 14)}.. (matches ${rs.matches}), the output names ${target.slice(0, 14)}..`);
else {
const runAt = Math.floor(Date.parse(rs.createdAt || '') / 1000);
const ordered = Number.isFinite(runAt) && Number.isFinite(outputAt) && runAt <= outputAt + TOLERANCE_S /*PAZA:order*/;
if (!ordered) fail('runtime', 'runtime-after-output', `the runtime record is dated ${rs.createdAt}, the output ${st.createdAt}`);
else {
let note = `host ${rs.host} declared the artifact running at ${rs.createdAt}`;
const log = bundle.runtime.auditLog;
if (Array.isArray(log)) {
const v = verificaJurnal(log);
if (!v.ok) { fail('runtime', 'audit-log-broken', `the audit log chain breaks at seq ${v.rupt}: ${v.motiv}`); }
else if (!log.some((e) => e.proof && lower(e.proof.statementHash) === lower(rec.statementHash)) /*PAZA:audit*/) fail('runtime', 'runtime-not-in-audit-log', 'the runtime record is not an entry of the audit log given');
else {
note += `; in the host's audit log (${log.length} entries, chain intact)`;
if (bundle.runtime.head) {
const c = verificaFataDeCap(log, bundle.runtime.head);
if (!c.ok) fail('runtime', 'audit-head', 'the log does not continue the attested head: ' + (c.motiv || ''));
else { note += `; continues the attested head (count ${bundle.runtime.head.statement && bundle.runtime.head.statement.count})`; if (bundle.runtime.head.notarization && rpc) { const hj = await judecatorAip23(verifyProof, bundle.runtime.head, { rpc, chain }); note += `; head finality ${hj ? parsed(hj, 'finality').state : 'UNMEASURED'}`; } }
}
}
} else note += '; no audit log given (the record stands alone)';
if (levels.runtime.state !== 'FAILED') levels.runtime = lvl('PASSED', { detail: note });
}
}
}
assumptions.runtime = ['the runtime record is the HOST\'s declaration (the sidecar reads the export the operator makes); it proves what the host said ran, not that it did; the audit log has no key and is judged against a head published outside the host'];
}
// 5. permissions: the ledger verifies under its policy, the output is an entry of it, allowed, at a matching time
let anchors = [], witnessNote = null;
if (bundle.witness && Array.isArray(bundle.witness.heads) && bundle.witness.heads.length) {
if (!rpc) { unm('witness', 'witness-needs-rpc', 'the notarized heads can be read only through an endpoint of the chain (--rpc)'); }
else {
const a = await anchorsFromNotarizedHeads(ledger, bundle.witness.heads, { verifyProof, rpc, chain: chain || bundle.witness.chainId || null });
if (a.stare === 'OK' && a.anchors.length) { anchors = a.anchors; witnessNote = a.randuri.map((r) => r.detail).join(' | '); }
else if (a.stare === 'FAILED') fail('witness', 'witness-head', a.randuri.filter((r) => !r.pass).map((r) => r.detail).join(' | '));
else unm('witness', 'witness-unmeasured', a.randuri.map((r) => r.detail).join(' | ') || 'no anchor could be read');
}
}
try {
const { policy, policyHash } = hashPolicy(bundle.permissions.policy);
if (bundle.permissions.policyHash && lower(bundle.permissions.policyHash) !== policyHash) fail('permissions', 'policy-hash', 'the bundle pins another policy hash than the policy given');
else {
const v = verifyLedger(ledger, { policy, policyHash, revocations: bundle.permissions.revocations || [], anchors, maxTime: now + TOLERANCE_S });
if (!v.ok) fail('permissions', 'ledger-invalid', String(v.error || '').slice(0, 200));
else {
const ph = provenanceHash(poa);
const entry = ledger.entries.find((e) => e.body && sameHash(e.body.provenance, ph)) /*PAZA:output-in-ledger*/;
if (!entry) fail('permissions', 'output-not-in-ledger', 'no ledger entry links this Proof of AI envelope (provenance hash ' + ph.slice(0, 14) + '..)');
else if (!(entry.body.decision && entry.body.decision.allowed === true) /*PAZA:allowed*/) fail('permissions', 'action-refused', `the ledger entry seq ${entry.seq} was refused: ${entry.body.decision && entry.body.decision.reason}`);
else if (!(Number.isFinite(outputAt) && Math.abs(Number(entry.body.at) - outputAt) <= TOLERANCE_S)) fail('permissions', 'ledger-time-mismatch', `the ledger entry is at ${entry.body.at}, the output at ${outputAt} (${st.createdAt})`);
else levels.permissions = lvl('PASSED', { detail: `entry seq ${entry.seq} (${entry.body.action && entry.body.action.kind}${entry.body.action && entry.body.action.tool ? ' ' + entry.body.action.tool : ''}) allowed under policy ${policyHash.slice(0, 14)}..; ${ledger.entries.length} entries verified, revocations ${v.revocations ? v.revocations.given : 0}, time ${v.time ? v.time.lowerBound : '?'}` });
if (anchors.length && levels.witness.state === 'ABSENT') levels.witness = lvl('PASSED', { detail: `${anchors.length} anchor(s) from notarized heads under a post-quantum certified state: ${witnessNote}` });
}
}
} catch (e) { fail('permissions', 'policy', String(e.message).slice(0, 160)); }
assumptions.permissions = ['the policy given is the one pinned (its hash is recomputed); revocations come from the owner, outside the ledger, and only those given are judged'];
// 6. provenance: the Proof of AI envelope itself
{
const j = await judecatorAip23(verifyProof, poa, { rpc: poa.notarization ? rpc : null, chain });
if (!j) unm('provenance', 'provenance-verifier', 'the AIP-23 reference verifier did not answer');
else if (poa.kind !== 'aere-proof-of-ai-attestation' || !envelopeOk(j)) fail('provenance', 'provenance-envelope', 'the Proof of AI envelope does not verify: ' + ['form', 'integrity', 'signature'].map((n) => n + ' ' + parsed(j, n).state).join(', '));
else if (poa.notarization && !rpc) unm('provenance', 'provenance-finality-needs-rpc', 'the envelope claims a notarization that only an endpoint can confirm');
else if (poa.notarization && parsed(j, 'finality').state !== 'PASSED') { const f = parsed(j, 'finality'); (f.state === 'FAILED' ? fail : unm)('provenance', 'provenance-finality', String(f.detail).slice(0, 200)); }
else levels.provenance = lvl('PASSED', { detail: `model ${st.model && st.model.name}@${st.model && st.model.version}, prompt ${String(st.promptHash).slice(0, 12)}.., output ${String(st.outputHash).slice(0, 12)}.., tools [${(st.tools || []).join(', ')}], requester ${String(st.requesterHash).slice(0, 12)}..; signature ${parsed(j, 'signature').state}${poa.notarization ? ', finality ' + parsed(j, 'finality').state : ''}` });
assumptions.provenance = ['digests only: the prompt, input, output and requester are proven to exist as the bytes whose hashes these are, not shown; the envelope\'s time is its producer\'s statement unless notarized'];
}
if (levels.witness.state !== 'ABSENT') assumptions.witness = ['the time is the chain\'s (the notary records the block time; on 28001 and 2800 every validator is run by the Foundation): whoever notarizes can only notarize late'];
else assumptions.witness = ['no witness: every time in this bundle is the statement of whoever holds the keys'];
return verdict(levels, assumptions);
}
function verdict(levels, assumptions) {
const failed = LEVELS.find((l) => levels[l].state === 'FAILED');
let v, reason = null;
if (failed) { v = 'INVALID'; reason = levels[failed].reason; }
else {
const unmL = LEVELS.find((l) => levels[l].state === 'UNMEASURED');
if (unmL) { v = 'PARTIAL'; reason = levels[unmL].reason; }
else if (levels.witness.state !== 'PASSED') { v = 'PARTIAL'; reason = 'unwitnessed'; }
else v = 'VALID';
}
return { verdict: v, reason, levels: Object.fromEntries(LEVELS.map((l) => [l, levels[l].state])), details: levels, assumptions,
notice: 'A verdict says that the bytes link and who vouches for each link. It does not say the model is good, the host is honest, or the output is true.' };
}
+162
View File
@@ -0,0 +1,162 @@
#!/usr/bin/env node
// proba-lant-de-incredere.mjs: the AI trust chain end to end in the LABORATORY, with the real children (Proof of Software attest,
// the verify-layer sidecar, the agent ledger, Proof of AI, the AIP-23 reference verifier), then the fixtures (each link broken on
// purpose, refused for its named reason), then the plantings (--control-negativ: a copy of the verifier with one check removed must
// turn exactly its fixture ROSU). --viu adds the witness: the ledger head notarized on testnet 28001 with the L1 test key, read back
// under a post-quantum certified anchor, and the bundle judged VALID with --rpc.
// node proba-lant-de-incredere.mjs [--viu] [--control-negativ]
import crypto from 'node:crypto';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { spawnSync } from 'node:child_process';
import { createRequire } from 'node:module';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { newAgentIdentity, openLedger } from '../agents/agent-ledger.mjs';
import { definePolicy } from '../agents/agent-policy.mjs';
import { buildProofOfAi } from '../proof-of-ai/proof-of-ai.mjs';
import { ledgerHeadEnvelope, notarizeHead, cheiaDinFisier } from '../agents/agent-ancora.mjs';
const AICI = path.dirname(fileURLToPath(import.meta.url));
const RAD = path.resolve(AICI, '..', '..');
// the children: the sidecar lives beside this component (public copy: ../verify-layer/, rewritten at staging); the AIP-23 reference
// verifier comes from AERE_VERIFY_PROOF (public copy, as for agents/) or from the development repository; without it: NEMASURAT (2)
const SIDECAR = fileURLToPath(new URL('../verify-layer/sidecar.mjs', import.meta.url));
const VERIFY_PROOF = process.env.AERE_VERIFY_PROOF || path.join(RAD, 'verificator-falcon', 'verify-proof.mjs');
const RPC_28001 = process.env.AERE_TESTNET_RPC || 'https://testnet-rpc.aere.network';
// --viu: the notarization key (gas only, a test key) and the folder whose node_modules hold ethers
const CHEIE = process.env.AERE_NOTARY_KEY_FILE || path.join(RAD, 'tools', 'aere-quantum-shield', 'dovezi-l1', '.chei', 'cheie-de-proba-28001.key');
const ETHERS_DIR = process.env.AERE_ETHERS_DIR || path.join(RAD, 'contracts');
// the model artifact and its Proof of Software attestation are a COMMITTED fixture (fixturi/: 4 KB of random bytes attested with
// laboratory keys by tools/proof-of-software/pos.mjs, which is not part of this component); regenerate with
// node ../proof-of-software/pos.mjs keygen --out k.json && node ../proof-of-software/pos.mjs attest --out fixturi/atestare-model.json --name aere-model-proba --version 1.0.0 --keys k.json fixturi/model-weights.bin
const FIXTURI = path.join(AICI, 'fixturi');
if (!fs.existsSync(VERIFY_PROOF)) { console.log(`NEMASURAT: verificatorul AIP-23 nu e la ${VERIFY_PROOF}; AERE_VERIFY_PROOF=<verify-proof.mjs>`); process.exit(2); }
const sha = (b) => '0x' + crypto.createHash('sha256').update(b).digest('hex');
const run = (args, cwd) => { const r = spawnSync(process.execPath, args, { cwd, encoding: 'utf8', timeout: 180000 }); if (r.status !== 0) throw new Error(`${path.basename(args[0])} ${args[1]} exited ${r.status}: ${(r.stdout + r.stderr).slice(-300)}`); return r.stdout; };
const rehash = (env) => ({ ...env, statementHash: sha(Buffer.from(JSON.stringify(env.statement), 'utf8')) });
const clone = (x) => JSON.parse(JSON.stringify(x));
/** the laboratory pieces: a model artifact attested, a host that ran it, an agent allowed to use it, an output */
export function laborator({ toolAllowed = true } = {}) {
const T = fs.mkdtempSync(path.join(os.tmpdir(), 'aere-ai-trust-lab-'));
// version: the committed fixture (the artifact and its hybrid-signed Proof of Software attestation); the digest is recomputed here,
// never read from the attestation, so a fixture whose artifact and attestation drifted apart is caught at P1
const art = path.join(T, 'model-weights.bin'); fs.copyFileSync(path.join(FIXTURI, 'model-weights.bin'), art); const artSha = sha(fs.readFileSync(art));
const attestation = JSON.parse(fs.readFileSync(path.join(FIXTURI, 'atestare-model.json'), 'utf8'));
// runtime: the host declares the artifact running, in its audit log, 60 s before the output
const t0 = Math.floor(Date.now() / 1000) - 120, t1 = t0 + 60;
const iso = (t) => new Date(t * 1000).toISOString();
run([SIDECAR, 'record', '--kind', 'runtime', '--artifact', art, '--attested', artSha, '--host', 'lab-probe', '--log', path.join(T, 'audit.log'), '--at', iso(t0)], T);
run([SIDECAR, 'attest-head', '--log', path.join(T, 'audit.log'), '--host', 'lab-probe', '--out', path.join(T, 'head.json')], T);
const auditLog = fs.readFileSync(path.join(T, 'audit.log'), 'utf8').split('\n').filter((l) => l.trim()).map((l) => JSON.parse(l));
const record = auditLog[0].proof; const head = JSON.parse(fs.readFileSync(path.join(T, 'head.json'), 'utf8'));
// permissions + identity: an agent allowed (or not) to call the model tool
const identity = newAgentIdentity();
const { policy, policyHash } = definePolicy({ agentId: identity.agentId, tools: toolAllowed ? ['model:aere-model-proba'] : ['model:other'] });
const ledger = openLedger({ identity, policy, policyHash, now: () => t1 });
// provenance: the output, naming the attested artifact and the agent
const proofOfAi = buildProofOfAi({ model: { name: 'aere-model-proba', version: '1.0.0', weightsSha256: artSha }, prompt: 'summarise document X', input: 'document X, 12 kB', output: 'a summary of document X', tools: ['model:aere-model-proba'], agentId: identity.agentId, requester: 'tester', createdAt: iso(t1) });
const r = ledger.record({ kind: 'tool', tool: 'model:aere-model-proba', args: { promptHash: proofOfAi.statement.promptHash } }, { provenance: proofOfAi, at: t1 });
return { T, art, artSha, attestation, record, auditLog, head, identity, policy, policyHash, ledger, proofOfAi, allowed: r.allowed, t0, t1 };
}
export async function proba(mod, cer, { viu = false } = {}) {
const L = laborator();
const bundle = mod.construieste({ ledger: L.ledger.export(), policy: { policy: L.policy, policyHash: L.policyHash }, proofOfAi: L.proofOfAi, software: { attestation: L.attestation }, runtime: { record: L.record, auditLog: L.auditLog, head: L.head } });
const v0 = await mod.verifica(bundle, { verifyProof: VERIFY_PROOF });
const toate = ['identity', 'version', 'runtime', 'permissions', 'provenance'];
cer('P1', 'laborator: toate cele cinci fatete PASSED, martorul ABSENT, verdict PARTIAL (unwitnessed)', toate.every((l) => v0.levels[l] === 'PASSED') && v0.levels.witness === 'ABSENT' && v0.verdict === 'PARTIAL' && v0.reason === 'unwitnessed' ? 'VERDE' : 'ROSU', `${v0.verdict} (${v0.reason}) ${JSON.stringify(v0.levels)}`);
cer('P2', 'intrarea registrului a fost PERMISA de politica (unealta model:aere-model-proba in lista)', L.allowed ? 'VERDE' : 'ROSU');
const v1 = await mod.verifica(mod.construieste({ ledger: L.ledger.export(), policy: { policy: L.policy, policyHash: L.policyHash }, proofOfAi: L.proofOfAi }), { verifyProof: VERIFY_PROOF });
cer('P3', 'fara versiune si fara runtime: nivelurile ABSENT, restul PASSED, tot PARTIAL unwitnessed (ce lipseste e spus, nu inventat)', v1.levels.version === 'ABSENT' && v1.levels.runtime === 'ABSENT' && v1.levels.permissions === 'PASSED' && v1.verdict === 'PARTIAL' ? 'VERDE' : 'ROSU', JSON.stringify(v1.levels));
// fixtures: each link broken on purpose
const fix = [
['F1', 'iesirea schimbata in Proof of AI (hash refacut): nu mai e intrarea din registru -> permissions FAILED output-not-in-ledger', (b) => { b.provenance.proofOfAi.statement.outputHash = sha(Buffer.from('another output')); b.provenance.proofOfAi = rehash(b.provenance.proofOfAi); }, 'permissions', 'output-not-in-ledger'],
['F2', 'digestul ponderilor schimbat in Proof of AI: nu e artefactul atestat -> version FAILED version-artifact-mismatch', (b) => { b.provenance.proofOfAi.statement.model.weightsSha256 = '0x' + 'ab'.repeat(32); b.provenance.proofOfAi = rehash(b.provenance.proofOfAi); }, 'version', 'version-artifact-mismatch'],
['F3', 'alt agentId in Proof of AI: identity FAILED identity-mismatch', (b) => { b.provenance.proofOfAi.statement.agentId = 'aere-agent:' + '11'.repeat(20); b.provenance.proofOfAi = rehash(b.provenance.proofOfAi); }, 'identity', 'identity-mismatch'],
['F4', 'inregistrarea de runtime numeste alt artefact: runtime FAILED runtime-artifact-mismatch', (b) => { b.runtime.record.statement.artifactSha256 = '0x' + 'cd'.repeat(32); b.runtime.record = rehash(b.runtime.record); }, 'runtime', 'runtime-artifact-mismatch'],
['F6', 'inregistrarea de runtime datata DUPA iesire: runtime FAILED runtime-after-output', (b) => { b.runtime.record.statement.createdAt = new Date((L.t1 + 3600) * 1000).toISOString(); b.runtime.record = rehash(b.runtime.record); }, 'runtime', 'runtime-after-output'],
['F7', 'o intrare a registrului modificata (argumentele): permissions FAILED ledger-invalid', (b) => { b.permissions.ledger.entries[0].body.action.args = { promptHash: '0x' + '00'.repeat(32) }; }, 'permissions', 'ledger-invalid'],
['F8', 'jurnalul de audit fara inregistrarea de runtime: runtime FAILED runtime-not-in-audit-log', (b) => { b.runtime.auditLog = []; b.runtime.head = null; }, 'runtime', 'runtime-not-in-audit-log'],
['F9', 'atestarea Proof of Software modificata dupa hash: version FAILED version-attestation', (b) => { b.version.attestation.statement.artifacts[0].sha256 = '0x' + 'ef'.repeat(32); }, 'version', 'version-attestation'],
['F10', 'jurnalul de audit cu lantul rupt (hash-ul intrarii schimbat): runtime FAILED audit-log-broken', (b) => { b.runtime.auditLog[0].hash = '0x' + '77'.repeat(32); }, 'runtime', 'audit-log-broken'],
];
for (const [id, eticheta, muta, nivel, motiv] of fix) {
const b = clone(bundle); muta(b);
const v = await mod.verifica(b, { verifyProof: VERIFY_PROOF });
const ok = v.verdict === 'INVALID' && v.levels[nivel] === 'FAILED' && v.details[nivel].reason === motiv;
cer(id, eticheta, ok ? 'VERDE' : 'ROSU', `${v.verdict} (${v.reason}); ${nivel} ${v.levels[nivel]} ${v.details[nivel].reason || ''}`);
}
{
const L2 = laborator({ toolAllowed: false });
const b = mod.construieste({ ledger: L2.ledger.export(), policy: { policy: L2.policy, policyHash: L2.policyHash }, proofOfAi: L2.proofOfAi, software: { attestation: L2.attestation }, runtime: { record: L2.record, auditLog: L2.auditLog } });
const v = await mod.verifica(b, { verifyProof: VERIFY_PROOF });
cer('F5', 'unealta nepermisa de politica: intrarea REFUZATA exista, iesirea nu poate fi "permisa" -> permissions FAILED action-refused', !L2.allowed && v.levels.permissions === 'FAILED' && v.details.permissions.reason === 'action-refused' ? 'VERDE' : 'ROSU', `${v.verdict} ${v.details.permissions.reason || ''}`);
}
if (viu) {
// the witness: the ledger head notarized on 28001 with the laboratory test key (gas only), read back under a certified anchor
const require = createRequire(path.join(ETHERS_DIR, 'package.json'));
const { ethers } = require('ethers');
const headEnv = ledgerHeadEnvelope(L.ledger.export());
let notarized;
// notarizeHead returns { ok, envelope }: the ENVELOPE (with its notarization) is the head the witness level reads
try { const r = await notarizeHead({ envelope: headEnv, rpc: RPC_28001, keyFile: CHEIE, ethers }); if (!r || !r.ok) throw new Error('notarizeHead: ' + JSON.stringify(r).slice(0, 160)); notarized = r.envelope; } catch (e) { cer('V1', 'capul registrului notarizat pe 28001', 'STRICAT', String(e.message).slice(0, 160)); return; }
cer('V1', 'capul registrului notarizat pe 28001 (cheia de proba L1, numai gaz)', notarized && notarized.notarization ? 'VERDE' : 'ROSU', notarized && notarized.notarization ? `tx ${String(notarized.notarization.txHash).slice(0, 14)}.. block ${notarized.notarization.block}` : JSON.stringify(notarized).slice(0, 120));
const bw = mod.construieste({ ledger: L.ledger.export(), policy: { policy: L.policy, policyHash: L.policyHash }, proofOfAi: L.proofOfAi, software: { attestation: L.attestation }, runtime: { record: L.record, auditLog: L.auditLog, head: L.head }, witness: { heads: [notarized], chainId: 28001 } });
let vw = null;
for (let i = 0; i < 20; i++) { vw = await mod.verifica(bw, { verifyProof: VERIFY_PROOF, rpc: RPC_28001, chain: 28001 }); if (vw.levels.witness !== 'UNMEASURED') break; await new Promise((ok) => setTimeout(ok, 8000)); }
cer('V2', 'cu martorul citit sub o ancora certificata (--rpc 28001): witness PASSED, verdict VALID', vw && vw.verdict === 'VALID' && vw.levels.witness === 'PASSED' ? 'VERDE' : (vw && vw.levels.witness === 'UNMEASURED' ? 'STRICAT' : 'ROSU'), vw ? `${vw.verdict} (${vw.reason}); witness ${vw.levels.witness}: ${String(vw.details.witness.detail || vw.details.witness.reason || '').slice(0, 160)}` : 'fara verdict');
const vb = await mod.verifica(bw, { verifyProof: VERIFY_PROOF });
cer('V3', 'acelasi pachet FARA --rpc: martorul UNMEASURED (witness-needs-rpc), nu PASSED', vb.levels.witness === 'UNMEASURED' && vb.verdict === 'PARTIAL' ? 'VERDE' : 'ROSU', `${vb.verdict} (${vb.reason})`);
const d = path.join(RAD, 'tools', 'aere-ai-trust', 'dovezi'); fs.mkdirSync(d, { recursive: true });
const f = path.join(d, `lant-28001-${new Date().toISOString().replace(/[:.]/g, '').slice(0, 15)}Z.json`);
fs.writeFileSync(f, JSON.stringify({ bundle: bw, verdict: vw }, null, 1)); console.log(' dovada scrisa: ' + f);
}
}
if (process.argv.includes('--control-negativ')) {
const SURSA = fs.readFileSync(path.join(AICI, 'lant-de-incredere.mjs'), 'utf8');
const PLANTARI = [
{ nume: '(a) identitatea necomparata', de: '/*PAZA:identity*/', cu: "|| String(1) === '1' /*PLANTAT*/", rosii: ['F3'] },
{ nume: '(b) artefactul atestat necomparat cu ponderile', de: '/*PAZA:version*/', cu: "|| String(1) === '1' /*PLANTAT*/", rosii: ['F2'] },
{ nume: '(c) artefactul rulat necomparat', de: '/*PAZA:runtime*/', cu: "|| String(1) === '1' /*PLANTAT*/", rosii: ['F4'] },
{ nume: '(d) ordinea timpilor nejudecata', de: '/*PAZA:order*/', cu: "|| String(1) === '1' /*PLANTAT*/", rosii: ['F6'] },
{ nume: '(e) iesirea necautata in registru (prima intrare luata oricum)', de: '/*PAZA:output-in-ledger*/', cu: '|| ledger.entries[0] /*PLANTAT*/', rosii: ['F1'] },
// (f) and (g) sit inside a NEGATED condition (`if (!(x) /*PAZA*/)`): the planting that silences the check is `&& false`, not `|| true`
// (measured 2026-10-02: `|| true` made the honest rows fail instead of letting the fixture pass)
{ nume: '(f) decizia refuzata luata drept permisa', de: '/*PAZA:allowed*/', cu: "&& String(1) === '2' /*PLANTAT*/", rosii: ['F5'] },
{ nume: '(g) inregistrarea necautata in jurnalul de audit', de: '/*PAZA:audit*/', cu: "&& String(1) === '2' /*PLANTAT*/", rosii: ['F8'] },
{ nume: '(h) controlul controlului: o ancora care nu exista', de: '/*PAZA:nu-exista*/', cu: 'x', rosii: [], asteapta: 'STRICAT' },
];
let bune = 0;
for (const [k, p] of PLANTARI.entries()) {
const n = SURSA.split(p.de).length - 1;
const copie = path.join(AICI, `_plantat-lant-${process.pid}-${k}.mjs`);
let stare, detaliu = '';
try {
if (n !== 1) { stare = 'STRICAT'; detaliu = `ancora apare de ${n} ori (cerut 1)`; }
else {
fs.writeFileSync(copie, SURSA.replace(p.de, p.cu));
const mod = await import(pathToFileURL(copie).href);
const randuri = [];
// a probe that THROWS on the planted copy is STRICAT for that planting, not the end of the control
try { await proba(mod, (id, eticheta, st, det) => randuri.push({ id, stare: st, det })); } catch (e) { randuri.push({ id: 'proba', stare: 'STRICAT', det: String(e.message).slice(0, 160) }); }
const stricate = randuri.filter((x) => x.stare === 'STRICAT'); const rosii = randuri.filter((x) => x.stare === 'ROSU').map((x) => x.id);
if (stricate.length) { stare = 'STRICAT'; detaliu = 'proba a cazut: ' + stricate.map((x) => x.id + ' ' + x.det).join(' | ').slice(0, 200); }
else { const prezise = p.rosii.every((id) => rosii.includes(id)); const numai = rosii.every((id) => p.rosii.includes(id)); stare = prezise && numai ? 'VERDE' : 'ROSU'; detaliu = `rosii: ${rosii.join(',') || '-'} (prezis ${p.rosii.join(',') || '-'})`; }
}
} finally { fs.rmSync(copie, { force: true }); }
const ok = stare === (p.asteapta || 'VERDE'); if (ok) bune++;
console.log(` ${ok ? 'BINE' : 'ESEC'} ${p.nume}: ${stare}${p.asteapta ? ' (prezis ' + p.asteapta + ')' : ''} ${detaliu}`);
}
const ramase = fs.readdirSync(AICI).filter((f) => f.startsWith('_plantat-lant-'));
console.log(`CONTROL: ${bune} din ${PLANTARI.length} cum s-a prezis${ramase.length ? '; copii ramase: ' + ramase.join(',') : ''}`);
process.exitCode = bune === PLANTARI.length && !ramase.length ? 0 : 1;
} else {
const mod = await import('./lant-de-incredere.mjs');
let verzi = 0, rosii = 0, stricate = 0;
await proba(mod, (id, eticheta, stare, det) => { if (stare === 'VERDE') verzi++; else if (stare === 'ROSU') rosii++; else stricate++; console.log(` [${stare.padEnd(7)}] ${id.padEnd(4)} ${eticheta}${det ? ' ' + det : ''}`); }, { viu: process.argv.includes('--viu') });
console.log(`\nlantul de incredere pentru AI: ${verzi} VERDE, ${rosii} ROSU, ${stricate} STRICAT`);
process.exitCode = rosii || stricate ? 1 : 0;
}