capsule-emit 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- capsule_emit-0.1.0/LICENSE +191 -0
- capsule_emit-0.1.0/NOTICE +13 -0
- capsule_emit-0.1.0/PKG-INFO +249 -0
- capsule_emit-0.1.0/README.md +217 -0
- capsule_emit-0.1.0/capsule_emit/__init__.py +43 -0
- capsule_emit-0.1.0/capsule_emit/adapters/__init__.py +6 -0
- capsule_emit-0.1.0/capsule_emit/adapters/_base.py +84 -0
- capsule_emit-0.1.0/capsule_emit/adapters/crewai.py +50 -0
- capsule_emit-0.1.0/capsule_emit/adapters/hermes.py +42 -0
- capsule_emit-0.1.0/capsule_emit/adapters/langchain.py +45 -0
- capsule_emit-0.1.0/capsule_emit/adapters/mcp.py +70 -0
- capsule_emit-0.1.0/capsule_emit/cli.py +57 -0
- capsule_emit-0.1.0/capsule_emit/core.py +168 -0
- capsule_emit-0.1.0/capsule_emit/ledger.py +105 -0
- capsule_emit-0.1.0/capsule_emit/manifest.py +167 -0
- capsule_emit-0.1.0/capsule_emit.egg-info/PKG-INFO +249 -0
- capsule_emit-0.1.0/capsule_emit.egg-info/SOURCES.txt +22 -0
- capsule_emit-0.1.0/capsule_emit.egg-info/dependency_links.txt +1 -0
- capsule_emit-0.1.0/capsule_emit.egg-info/entry_points.txt +2 -0
- capsule_emit-0.1.0/capsule_emit.egg-info/requires.txt +15 -0
- capsule_emit-0.1.0/capsule_emit.egg-info/top_level.txt +1 -0
- capsule_emit-0.1.0/pyproject.toml +54 -0
- capsule_emit-0.1.0/setup.cfg +4 -0
- capsule_emit-0.1.0/tests/test_quickstart.py +251 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other transformations
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and its Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of discussing and
|
|
55
|
+
improving the Work, but excluding communication that is conspicuously
|
|
56
|
+
marked or otherwise designated in writing by the copyright owner as
|
|
57
|
+
"Not a Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those patent claims licensable
|
|
76
|
+
by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by combination of their Contributions with
|
|
78
|
+
the Work to which such Contribution(s) was submitted. If You
|
|
79
|
+
institute patent litigation against any entity (including a
|
|
80
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
81
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
82
|
+
or contributory patent infringement, then any patent licenses
|
|
83
|
+
granted to You under this License for that Work shall terminate
|
|
84
|
+
as of the date such litigation is filed.
|
|
85
|
+
|
|
86
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
88
|
+
modifications, and in Source or Object form, provided that You
|
|
89
|
+
meet the following conditions:
|
|
90
|
+
|
|
91
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
92
|
+
Works a copy of this License; and
|
|
93
|
+
|
|
94
|
+
(b) You must cause any modified files to carry prominent notices
|
|
95
|
+
stating that You changed the files; and
|
|
96
|
+
|
|
97
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
98
|
+
that You distribute, all copyright, patent, trademark, and
|
|
99
|
+
attribution notices from the Source form of the Work,
|
|
100
|
+
excluding those notices that do not pertain to any part of
|
|
101
|
+
the Derivative Works; and
|
|
102
|
+
|
|
103
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
104
|
+
distribution, You must include a readable copy of the
|
|
105
|
+
attribution notices contained within such NOTICE file, in
|
|
106
|
+
at least one of the following places: within a NOTICE text
|
|
107
|
+
file distributed as part of the Derivative Works; within
|
|
108
|
+
the Source form or documentation, if provided along with the
|
|
109
|
+
Derivative Works; or, within a display generated by the
|
|
110
|
+
Derivative Works, if and wherever such third-party notices
|
|
111
|
+
normally appear. The contents of the NOTICE file are for
|
|
112
|
+
informational purposes only and do not modify the License.
|
|
113
|
+
You may add Your own attribution notices within Derivative
|
|
114
|
+
Works that You distribute, alongside or in addition to the
|
|
115
|
+
NOTICE text from the Work, provided that such additional
|
|
116
|
+
attribution notices cannot be construed as modifying the License.
|
|
117
|
+
|
|
118
|
+
You may add Your own license statement for Your modifications and
|
|
119
|
+
may provide additional grant of rights to use, copy, modify, merge,
|
|
120
|
+
publish, distribute, sublicense, and/or sell copies of the
|
|
121
|
+
Contribution, either as is or with modifications, and to grant
|
|
122
|
+
third parties a sublicense to use, copy, modify, merge, publish,
|
|
123
|
+
distribute, sublicense, and/or sell copies of the Contribution.
|
|
124
|
+
|
|
125
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
126
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
127
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
128
|
+
this License, without any additional terms or conditions.
|
|
129
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
130
|
+
the terms of any separate license agreement you may have executed
|
|
131
|
+
with Licensor regarding such Contributions.
|
|
132
|
+
|
|
133
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
134
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
135
|
+
except as required for reasonable and customary use in describing the
|
|
136
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
137
|
+
|
|
138
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
139
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
140
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
141
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
142
|
+
implied, including, without limitation, any warranties or conditions
|
|
143
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
144
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
145
|
+
appropriateness of using or reproducing the Work and assume any
|
|
146
|
+
risks associated with Your exercise of permissions under this License.
|
|
147
|
+
|
|
148
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
149
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
150
|
+
unless required by applicable law (such as deliberate and grossly
|
|
151
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
152
|
+
liable to You for damages, including any direct, indirect, special,
|
|
153
|
+
incidental, or exemplary damages of any character arising as a
|
|
154
|
+
result of this License or out of the use or inability to use the
|
|
155
|
+
Work (even if such Contributor has been advised of the possibility
|
|
156
|
+
of such damages).
|
|
157
|
+
|
|
158
|
+
9. Accepting Warranty or Liability. While redistributing the Work or
|
|
159
|
+
Derivative Works thereof, You may choose to offer, and charge a fee
|
|
160
|
+
for, acceptance of support, warranty, indemnity, or other liability
|
|
161
|
+
obligations and/or rights consistent with this License. However, in
|
|
162
|
+
accepting such obligations, You may offer such conditions only on
|
|
163
|
+
Your own behalf and on Your sole responsibility, not on behalf of
|
|
164
|
+
any other Contributor, and only if You agree to indemnify, defend,
|
|
165
|
+
and hold each Contributor harmless for any liability incurred by,
|
|
166
|
+
or claims asserted against, such Contributor by reason of your
|
|
167
|
+
accepting any such warranty or additional liability.
|
|
168
|
+
|
|
169
|
+
END OF TERMS AND CONDITIONS
|
|
170
|
+
|
|
171
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
172
|
+
|
|
173
|
+
To apply the Apache License to your work, attach the following
|
|
174
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
175
|
+
replaced with your own identifying information. (Don't include
|
|
176
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
177
|
+
comment syntax for the file format in question.
|
|
178
|
+
|
|
179
|
+
Copyright 2024-2026 Action State Group, Inc.
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
190
|
+
implied. See the License for the specific language governing
|
|
191
|
+
permissions and limitations under the License.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
capsule-emit
|
|
2
|
+
Copyright 2024-2026 Action State Group, Inc.
|
|
3
|
+
|
|
4
|
+
This product is developed by Action State Group, Inc. and is published
|
|
5
|
+
as open-source software under the Apache License, Version 2.0.
|
|
6
|
+
|
|
7
|
+
The Agent Action Capsule specification (draft-mih-scitt-agent-action-capsule)
|
|
8
|
+
is developed and maintained at:
|
|
9
|
+
https://github.com/action-state-group/agent-action-capsule
|
|
10
|
+
|
|
11
|
+
This library is a producer/emission layer for that specification.
|
|
12
|
+
It depends on the agent-action-capsule reference library for capsule
|
|
13
|
+
construction and Class-1 verification.
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: capsule-emit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: One-call emit() for Agent Action Capsules — anchor on by default, ledger view CLI, thin framework adapters.
|
|
5
|
+
Author: Action State Group
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/action-state-group/capsule-emit
|
|
8
|
+
Project-URL: Source, https://github.com/action-state-group/capsule-emit
|
|
9
|
+
Project-URL: Tracker, https://github.com/action-state-group/capsule-emit/issues
|
|
10
|
+
Project-URL: Specification, https://github.com/action-state-group/agent-action-capsule
|
|
11
|
+
Project-URL: Organization, https://github.com/action-state-group
|
|
12
|
+
Keywords: scitt,agent,capsule,verification,transparency,audit
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Security :: Cryptography
|
|
16
|
+
Classifier: Development Status :: 3 - Alpha
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
License-File: NOTICE
|
|
21
|
+
Requires-Dist: agent-action-capsule>=0.0.2
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
24
|
+
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
25
|
+
Provides-Extra: langchain
|
|
26
|
+
Requires-Dist: langchain-core>=0.1; extra == "langchain"
|
|
27
|
+
Provides-Extra: crewai
|
|
28
|
+
Requires-Dist: crewai>=0.40; extra == "crewai"
|
|
29
|
+
Provides-Extra: mcp
|
|
30
|
+
Provides-Extra: hermes
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# capsule-emit
|
|
34
|
+
|
|
35
|
+
**One call to seal a tamper-evident, independently-verifiable record of what your AI agent actually did.**
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from capsule_emit import emit
|
|
39
|
+
|
|
40
|
+
cap = emit(action="write_po", operator="acme-co", developer="po-agent@v1",
|
|
41
|
+
agent_input={"vendor": "Frobozz Supply", "total": 1240.19},
|
|
42
|
+
agent_output=result, verdict="executed",
|
|
43
|
+
effect={"type": "write_po", "status": "dispatched"})
|
|
44
|
+
|
|
45
|
+
print(cap.capsule_id) # sealed, anchored, verifiable by anyone
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`capsule-emit` is the producer layer for the **Agent Action Capsule** — a [SCITT](https://datatracker.ietf.org/doc/draft-mih-scitt-agent-action-capsule/) statement profile. You add one line at the moment your agent does something consequential; you get back a signed, digest-committed capsule that a third party who trusts neither you nor your agent can independently verify.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Why you need this
|
|
53
|
+
|
|
54
|
+
Agents now move money, change records, and act across organizational boundaries. When something goes wrong — or someone asks "did your agent really do that, and was it authorized?" — what's your proof?
|
|
55
|
+
|
|
56
|
+
Your **logs** are your own word. They're mutable, they live in your database, and they mean nothing to an auditor, a counterparty, or a regulator who has no reason to trust your systems. There's no way for an outside party to confirm a log wasn't edited after the fact.
|
|
57
|
+
|
|
58
|
+
A **capsule** is different: it's signed at the moment of the action, its content is committed to a hash, and it's recorded in a public append-only log. Anyone can verify it offline, from the bytes alone — *without trusting you*.
|
|
59
|
+
|
|
60
|
+
## Why your existing stack can't do this
|
|
61
|
+
|
|
62
|
+
These layers answer **different questions** — a capsule fills the gap none of them cover:
|
|
63
|
+
|
|
64
|
+
| Layer | Examples | Answers | Doesn't answer |
|
|
65
|
+
|---|---|---|---|
|
|
66
|
+
| **Identity** | DIDs, SPIFFE, Agent Cards | *Who* is the agent? | What it did |
|
|
67
|
+
| **Authorization** | OPA, policy, permits | What is it *allowed* to do? | What it actually did, or the outcome |
|
|
68
|
+
| **Observability** | Datadog, audit logs, your DB | What *you say* happened | Nothing to a party who doesn't trust you — mutable, self-attested |
|
|
69
|
+
| **Agent Action Capsule** | `capsule-emit` | **What it *did*, provably** | (composes with the above by reference) |
|
|
70
|
+
|
|
71
|
+
A capsule records the action **and its outcome**, with a *confirmed-effect binding* so a **dispatched attempt can't be passed off as a completed effect** (the may/did distinction: approved ≠ executed ≠ confirmed). It records on **every verdict, including refusals** — a `blocked` capsule is auditor-grade evidence that a gate worked.
|
|
72
|
+
|
|
73
|
+
## Concepts
|
|
74
|
+
|
|
75
|
+
A small vocabulary — each concept maps to a field you can see or a command you can run:
|
|
76
|
+
|
|
77
|
+
- **Capsule** — the unit: one consequential action *and its outcome*, sealed, signed, and digest-committed. It's plain JSON — inspect it with `cap.capsule` (see *What's in a capsule* below).
|
|
78
|
+
- **may / did** — the honesty model: *approved ≠ executed ≠ confirmed*. A capsule carries the verdict (`disposition.verdict_class`) **and** a confirmed-effect binding (`effect.status` + request/response digests), so a *dispatched attempt* can never be presented as a *completed effect*.
|
|
79
|
+
- **Chain** — actions link by digest: a confirm / supersede / escalate capsule points at its parent (`chain.parent_capsule_id`), turning *approved → executed → confirmed* (or *deferred → escalated → resolved*) into one verifiable trail. → `emit(..., confirms=parent_id)`
|
|
80
|
+
- **Break** — tamper-evidence: change a single byte and the recomputed `capsule_id` stops matching, so `verify` returns **INVALID**. The break *is* the proof — it's what makes the record trustworthy to someone who didn't write it.
|
|
81
|
+
- **Anchor** — the public proof: the capsule's digest is written to an append-only transparency log; the receipt proves it existed at time T, checkable by anyone *without trusting you* (see *Anchoring* below).
|
|
82
|
+
- **Ledger** — your local append-only trail of capsules (the chain of chains). → `capsule-emit ledger view ./ledger.jsonl`
|
|
83
|
+
- **Verify** — anyone, offline, from the bytes alone — no keys, no network, no clock. Class-1 (structure + IDs), Class-2 (manifest-aware). Independent of the producer on purpose (see *Verify* below).
|
|
84
|
+
- **Declare → Enforce** — a `manifest.md` *declares* autonomy + constraints; a compatible gateway *enforces* the same file later, with **no change** to your `emit()` calls (see *Declare now, enforce later* below).
|
|
85
|
+
|
|
86
|
+
The sections below are the depth behind each concept.
|
|
87
|
+
|
|
88
|
+
## How easy it is
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pip install capsule-emit # emit + anchor client + ledger CLI
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
from capsule_emit import emit
|
|
96
|
+
|
|
97
|
+
cap = emit(
|
|
98
|
+
action="write_po",
|
|
99
|
+
operator="acme-co", # the accountable tenant
|
|
100
|
+
developer="po-agent@v1", # the agent identity + version
|
|
101
|
+
agent_input={"vendor": "Frobozz Supply", "total": 1240.19},
|
|
102
|
+
agent_output=result,
|
|
103
|
+
model={"provider": "anthropic", "model_id": "claude-sonnet-4-6"},
|
|
104
|
+
verdict="executed", # executed | blocked | denied | errored | timed_out
|
|
105
|
+
effect={"type": "write_po", "status": "dispatched"},
|
|
106
|
+
)
|
|
107
|
+
print(cap.capsule_id, cap.anchored)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
That's it. The capsule is sealed and anchored. One call per consequential action.
|
|
111
|
+
|
|
112
|
+
## What's inside a capsule
|
|
113
|
+
|
|
114
|
+
`emit()` returns `cap.capsule` — a JSON object you can inspect, store, or hand to anyone:
|
|
115
|
+
|
|
116
|
+
```jsonc
|
|
117
|
+
{
|
|
118
|
+
"spec_version": "draft-mih-scitt-agent-action-capsule-01",
|
|
119
|
+
"format_version": "2",
|
|
120
|
+
"capsule_id": "9fddfcec…32eb26", // SHA-256 of the canonical payload (its content address)
|
|
121
|
+
"action_id": "write_po/39530d9c…", // the action name + a unique id (chain linkage)
|
|
122
|
+
"action_type": "decide", // the capsule class (a decision that produced an effect)
|
|
123
|
+
"operator": "acme-co", // accountable tenant
|
|
124
|
+
"developer": "po-agent@v1", // agent identity + version
|
|
125
|
+
"timestamp": "2026-06-20T04:45:11Z",
|
|
126
|
+
"model_attestation": { // which model + the evidence it produced
|
|
127
|
+
"provider": "anthropic",
|
|
128
|
+
"model_id": "claude-sonnet-4-6",
|
|
129
|
+
"compute_attestation": {
|
|
130
|
+
"agent_input_digest": "3c2c9123…", // the prompt/input, sealed by hash
|
|
131
|
+
"agent_output_digest": "c574d16d…" // the inference/output, sealed by hash
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"effect": { // what was committed
|
|
135
|
+
"type": "write_po",
|
|
136
|
+
"status": "dispatched", // dispatched (attempted) vs confirmed (observed)
|
|
137
|
+
"effect_attestation": "runtime_claimed"
|
|
138
|
+
},
|
|
139
|
+
"disposition": { // the may/did verdict
|
|
140
|
+
"decision": "accept",
|
|
141
|
+
"verdict_class": "executed", // executed | blocked | denied | errored | confirmed
|
|
142
|
+
"approver": "policy",
|
|
143
|
+
"human_disposed": false // honest in-the-loop flag
|
|
144
|
+
},
|
|
145
|
+
"assurance": { // how far to trust each part
|
|
146
|
+
"attestation_mode": "self_attested",
|
|
147
|
+
"effect_mode": "dispatched_unconfirmed",
|
|
148
|
+
"ledger_mode": "standalone" // standalone | chained
|
|
149
|
+
}
|
|
150
|
+
// When a capsule confirms/supersedes another, a "chain" block appears and
|
|
151
|
+
// the effect gains a "response_digest" (the confirmed-effect binding):
|
|
152
|
+
// "chain": { "parent_capsule_id": "1008e6fc…", "relation": "confirms" }
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Confirming or superseding an action is itself a capsule that **chains** to the first — that's how "approved → executed → confirmed" becomes a verifiable trail. Full field reference: the [spec](https://datatracker.ietf.org/doc/draft-mih-scitt-agent-action-capsule/) §5.
|
|
157
|
+
|
|
158
|
+
## Anchoring — where the proof lives
|
|
159
|
+
|
|
160
|
+
**Anchor is on by default.** When you `emit()`, the capsule's **digest only** is submitted to a SCITT transparency log, and you get back an [RFC 9162](https://www.rfc-editor.org/rfc/rfc9162) inclusion-proof **receipt** — durable, tamper-evident evidence that this exact capsule existed at that time.
|
|
161
|
+
|
|
162
|
+
- **Where:** the free hosted log at `https://anchor.agentactioncapsule.org/v1/digest` (no signup, no key).
|
|
163
|
+
- **What's logged:** a **SHA-256 digest** (the `capsule_id`) — nothing else. Your vendors, amounts, operator, and payloads **never leave your machine**.
|
|
164
|
+
- **What you get:** the receipt (an inclusion proof) — keep it with the capsule; anyone can later check the capsule against the log offline.
|
|
165
|
+
- **Self-host or repoint:** the log service ([`capsule-anchor`](https://github.com/action-state-group/capsule-anchor)) is open-source. Point anywhere with `AAC_ANCHOR_URL=https://your-log/...` or `emit(..., anchor_url=...)`.
|
|
166
|
+
- **Offline:** `emit(..., anchor=False)` seals locally and skips the network.
|
|
167
|
+
- **Why bother:** a self-hosted log you control isn't proof to an outsider; a shared, append-only transparency log is. That's what makes the capsule checkable by someone who trusts neither party.
|
|
168
|
+
|
|
169
|
+
## Verify
|
|
170
|
+
|
|
171
|
+
The verifier ships in the spec package — install it and check any capsule (or a whole ledger) from the bytes alone, no keys/network/clock:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
pip install agent-action-capsule
|
|
175
|
+
agent-action-capsule verify ./ledger.jsonl
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Tamper with one byte and verification fails. The verifier is independent of `capsule-emit` on purpose — *any* tool can produce a capsule; *any* party can verify one.
|
|
179
|
+
|
|
180
|
+
## Ledger view
|
|
181
|
+
|
|
182
|
+
Every `emit()` appends to a local JSONL ledger:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
capsule-emit ledger view ./ledger.jsonl
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Framework adapters
|
|
189
|
+
|
|
190
|
+
One `emit()` per tool call, regardless of framework — thin adapters over one shared base:
|
|
191
|
+
|
|
192
|
+
```python
|
|
193
|
+
from capsule_emit.adapters.mcp import MCPCapsuleEmitter # primary (MCP)
|
|
194
|
+
emitter = MCPCapsuleEmitter(operator="acme-co", developer="my-agent@v1")
|
|
195
|
+
|
|
196
|
+
@emitter.tool("write_po")
|
|
197
|
+
def write_po(vendor: str, total: float) -> dict: ...
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
LangChain (`LangChainCapsuleEmitter`, a callback handler), CrewAI (`CrewAICapsuleEmitter`, `.wrap(tool)`), and Hermes (`HermesCapsuleEmitter`, `.after_tool(...)`) work the same way. **Per-adapter guides — where to put the call, the one-line add, and a ready-made prompt for your coding agent — are in [`docs/adapters/`](docs/adapters/).**
|
|
201
|
+
|
|
202
|
+
## Declare now, enforce later — same file
|
|
203
|
+
|
|
204
|
+
Drop a `flows/<action>/manifest.md` next to your code to declare autonomy + constraints:
|
|
205
|
+
|
|
206
|
+
```markdown
|
|
207
|
+
---
|
|
208
|
+
wicket_id: write-po
|
|
209
|
+
autonomy: narrate
|
|
210
|
+
---
|
|
211
|
+
## Constraints
|
|
212
|
+
| id | what it checks | method | severity |
|
|
213
|
+
|----|----------------|--------|----------|
|
|
214
|
+
| po_arithmetic | Line items re-add to total. | arithmetic_balance | block |
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
`capsule-emit` reads the manifest to **declare** (no enforcement). A compatible gateway reads the **same file** and **enforces** — adding enforcement requires **no changes** to your `emit()` calls or manifests.
|
|
218
|
+
|
|
219
|
+
## How it fits
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
capsule-emit → agent-action-capsule (spec + reference verifier)
|
|
223
|
+
↓
|
|
224
|
+
scitt-cose (COSE_Sign1 + SCITT receipt verification)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
`capsule-emit` produces; [`agent-action-capsule`](https://github.com/action-state-group/agent-action-capsule) is the specification + verifier; [`scitt-cose`](https://github.com/action-state-group/scitt-cose) verifies the transparency-log substrate. Separate on purpose.
|
|
228
|
+
|
|
229
|
+
## Documentation
|
|
230
|
+
|
|
231
|
+
New here? These are written to be read top-to-bottom, no standards background needed:
|
|
232
|
+
|
|
233
|
+
- **[Tutorials](docs/tutorials/)** — five-minute, copy-paste sessions: your first capsule → confirming & chaining → reading your ledger → declaring rules.
|
|
234
|
+
- **[Concepts in plain words](docs/concepts.md)** — the seven words (capsule, seal, may/did, chain, break, anchor, ledger), each tied to a field or command.
|
|
235
|
+
- **[Anatomy of a capsule](docs/anatomy.md)** — exactly what gets sealed, the two-tier structure, and how each layer is captured.
|
|
236
|
+
- **[Adapters](docs/adapters/)** — let MCP / LangChain / CrewAI / Hermes emit capsules for you (with a paste-to-your-coding-agent prompt on each page).
|
|
237
|
+
- **[Going deeper — and popping out](docs/going-deeper.md)** — *down* into the spec + `scitt-cose` substrate if you want to verify it yourself; *up* to a compatible enforcement gateway (e.g. `gopher-ai`, OSS) when you want capsules to **block**, not just record.
|
|
238
|
+
|
|
239
|
+
## Status
|
|
240
|
+
|
|
241
|
+
Alpha — API stable, not yet 1.0. The underlying specification is an **individual IETF Internet-Draft**, not an RFC; no RFC number is claimed.
|
|
242
|
+
|
|
243
|
+
## Provenance, neutrality & governance
|
|
244
|
+
|
|
245
|
+
Developed by **Action State Group, Inc.** and published as **open-source software (Apache-2.0)**, with a clean transfer path to a **neutral home** (foundation donation or community project) as the ecosystem matures. The content is product-free — the emission layer, adapters, ledger utilities, and a manifest parser; nothing tenant- or product-specific. No primacy is claimed; the value is an interoperable, independently-verifiable record format. Discussion venue: the IETF **SCITT** Working Group (`scitt@ietf.org`).
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
Apache-2.0 — see [LICENSE](LICENSE).
|