This release is a pre-release and may not be stable for production use.
Agent Blackbox
Python reference recorder for the Judgment Event Protocol (JEP). Wrap a function, store signed event records with evidence digests and declared links, then inspect an incident or verify local record integrity.
Core Features
| Feature | Description |
|---|---|
| Trace decorator | Wrap agent functions and record runtime events |
| JEP-style event | Emits JEP Core 0.7-style J/D/T/V event objects with stable Event Identity |
| Declared links | Records parent relationships for incident review |
| Evidence digests | Records input/output/error digests |
| Local blackbox log | Stores JSONL event records for later review |
| Incident review | Reconstructs declared chain fragments around an incident |
| Integrity check | Verifies event hashes and Ed25519 signatures generated by this library |
Installation
Install the published distribution:
python -m pip install "agent-blackbox-jep==0.3.0a5"
The distribution is agent-blackbox-jep, the Python import is agent_blackbox,
and the CLI commands are agent-blackbox and blame-finder.
Version 0.3.0a5 can reopen a saved journal and verify signatures with the recorder's saved public keys. To develop from a local checkout, run
pip install -e .
Basic Usage
from agent_blackbox import AgentBlackbox
blackbox = AgentBlackbox(storage="./blackbox_logs")
@blackbox.trace(agent_name="CoderAgent")
def write_code(requirement: str) -> str:
return "print('hello world')"
result = write_code("write a hello world")
# Review the latest event
event_hash = list(blackbox.events.keys())[-1]
report = blackbox.review_incident(event_hash)
print(report["candidate_failure_node"])
print(report["chain"])
print(event_hash) # Save this identifier for a later CLI session.
Incident Review Output
Example:
{
"incident": "sha256:...",
"candidate_failure_node": "CoderAgent",
"diagnostic_summary": "The selected event has status failed. Review declared parents and evidence references.",
"review_score": 0.72,
"score_basis": "selected_event_failed",
"chain": [
{
"event_hash": "sha256:...",
"agent": "PlannerAgent",
"status": "success"
},
{
"event_hash": "sha256:...",
"agent": "CoderAgent",
"status": "failed"
}
],
"boundary": {
"not_legal_liability": true,
"not_factual_causality_proof": true,
"not_compliance_determination": true
}
}
The recorder assigns a fixed review score using the first matching rule below.
The Python compatibility method blame() calls this same value confidence.
These values express a review convention and have no statistical calibration.
| Observed in the journal | score_basis |
Score |
|---|---|---|
| Requested event is absent | event_not_found |
0.00 |
Requested event has status failed |
selected_event_failed |
0.72 |
A declared ancestor has status failed |
declared_ancestor_failed |
0.62 |
Observed chain contains no event with status failed |
no_observed_failure |
0.25 |
CLI
After the recorder process exits, use its printed event hash and the same storage directory in a new shell.
agent-blackbox --storage ./blackbox_logs review "$EVENT_HASH"
Show a chain tree:
agent-blackbox --storage ./blackbox_logs tree "$EVENT_HASH"
Verify an event:
agent-blackbox --storage ./blackbox_logs verify "$EVENT_HASH"
The CLI verifies every event returned by review or tree. A signed record
of a failed task can be reviewed successfully. All commands write JSON to
stdout and place diagnostics on stderr when verification cannot finish.
| Exit code | verification_status |
Meaning |
|---|---|---|
| 0 | verified |
All requested records verified |
| 3 | not_found |
Requested event or a required declared ancestor is missing |
| 4 | unknown_key |
No trusted public key for this actor and key ID |
| 5 | invalid_record |
Unreadable record, inconsistent hash or metadata, or invalid signature/key |
| 6 | storage_error |
Journal or key storage could not be accessed |
GitHub Action
Make the journal available on the runner and provision the recorder's public keys from a trusted source. Supply the event hash produced by your recording step.
- uses: hjs-spec/Agent-Blackbox@v0.3.0a5
id: review
with:
event_hash: ${{ steps.record.outputs.event_hash }}
storage_path: ./blackbox_logs
trusted_keys_path: ./trusted-recorder-keys
Pin the action to the reviewed commit for reproducible runs. On success,
steps.review.outputs.review_result contains JSON and
steps.review.outputs.candidate_failure_node names the candidate. Missing
records, unknown keys and failed verification fail the step.
Boundary Statement
New events use Core 0.7
with Event Identity (who,id). Event Hash identifies the exact signed artifact
and is the lookup key in the local store. The trace decorator records judgments;
D/T/V events require explicit creation with their required fields.
Verification checks event integrity under the recorder's local key and the recorded links. It does not establish factual causality, legal responsibility or log completeness. See the current alpha releases for the packaged implementation.
License
MIT
Runtime and verification notes
See the runtime notes for event extensions, key handling and import compatibility.
Metadata
Release files for agent-blackbox-jep 0.3.0a5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_blackbox_jep-0.3.0a5.tar.gz | 18.8 kB | With provenance | Details for agent_blackbox_jep-0.3.0a5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_blackbox_jep-0.3.0a5-py3-none-any.whl | Python 3 | none | any | Details for agent_blackbox_jep-0.3.0a5-py3-none-any.whl |
Total release size: 34.7 kB
Release files / agent_blackbox_jep-0.3.0a5.tar.gz
| Download URL | agent_blackbox_jep-0.3.0a5.tar.gz |
|---|---|
| Size | 18.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
473035a34273cfe04a821c2af7fa2a6a4aa85e5a6b04044c3d613eea5702379f
|
|
BLAKE2b-256 checksum How to use checksums |
1bda39ebeaffbea336cd9b832abb3d769eedb4afc7791d46ebddd16c3e40d86f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / agent_blackbox_jep-0.3.0a5-py3-none-any.whl
| Download URL | agent_blackbox_jep-0.3.0a5-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7038a37fd340e14f4d3c7eff30b31c08141f1357c872000d558caeeb091d2116
|
|
BLAKE2b-256 checksum How to use checksums |
1af54acb17b329f7569d61bcadbe6e5167c5013ec4870d5dbf833c18111a9183
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for agent-blackbox-jep 0.3.0a5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_blackbox_jep-0.3.0a5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.