Skip to main content

A memory firewall for coding agents — thin Python SDK over the dent8 CLI's JSON contract.

Project description

dent8 (Python)

A memory firewall for coding agents — the thin Python SDK.

Every call runs the dent8 binary with --output json and returns the parsed payload as a dict. The wire contract is the product: each payload carries schema_version; every error carries a stable status plus a machine-readable code (insufficient-authority, authority-ceiling, content-rejected, …), raised as Dent8Rejected / Dent8Invalid so you branch on error.code, never on prose.

Because the CLI resolves the store itself (repo-confined .dent8/ discovery, DENT8_LOG / DENT8_STORE_URL), routes writes through a local daemon when DENT8_DAEMON_SOCKET is set, and defaults --source/--authority from the active signed grant, the SDK inherits all of it with zero configuration.

Install

pip install dent8
cargo install dent8-cli --locked   # the binary the SDK drives

Use

from dent8 import Dent8, Dent8Rejected

d8 = Dent8()  # finds `dent8` on PATH; Dent8(binary=..., env={"DENT8_LOG": ...}) to pin

d8.assert_fact("repo:myproj", "database", "postgres",
               authority="high", source="user:alice")

try:
    d8.supersede("repo:myproj", "database", "mysql",
                 authority="low", source="web:scrape")
except Dent8Rejected as rejection:
    assert rejection.code == "insufficient-authority"   # branch on the code

fact = d8.explain("repo:myproj", "database")
assert fact["value"]["text"] == "postgres"              # the firewall held

report = d8.verify()          # findings are a result: status ok | integrity_issues
disputes = d8.conflicts()     # status contested when live disputes exist

The belief surface maps 1:1 onto the CLI: assert_fact (Python keyword), supersede, contradict, retract, reinforce, expire, derive(basis=(subject, predicate)), explain, replay, facts, verify, conflicts. Temporal keywords accept the CLI's whole grammar — unix millis, "now", "-7d", RFC 3339, or a bare UTC date.

For LLM tool-calling agents, prefer the MCP server (dent8 mcp serve) — see examples/langchain and examples/vercel-ai-sdk. This SDK is for programmatic access from Python code.

Test

cargo build -p dent8-cli
DENT8_BIN=../../target/debug/dent8 python -m pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dent8-0.7.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dent8-0.7.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file dent8-0.7.0.tar.gz.

File metadata

  • Download URL: dent8-0.7.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dent8-0.7.0.tar.gz
Algorithm Hash digest
SHA256 e5fc44a0b6349bbf0855e46d139c7242c19872ee45c375fcfc98462ae413d2ae
MD5 81abf56317d3d5386701ac5949592f70
BLAKE2b-256 dc81d429f88d4c6fc9961f118002b4c47c3e6e6071534bcf41cabba74e4f8772

See more details on using hashes here.

Provenance

The following attestation bundles were made for dent8-0.7.0.tar.gz:

Publisher: release.yml on xyzzylabs/dent8

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dent8-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: dent8-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dent8-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e0ac7fd8d5ca314470ae6c04e2153b71d20eca3255e0e02e656c347a4e3cdc5
MD5 67a710c09ba75e8b30bbecef0fd83e7b
BLAKE2b-256 d31ee612e449e98be9988b261c1e44269ba3ce285fd20c9f104368afd4aac317

See more details on using hashes here.

Provenance

The following attestation bundles were made for dent8-0.7.0-py3-none-any.whl:

Publisher: release.yml on xyzzylabs/dent8

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page