Skip to main content

Lightweight audit client for Ghost_Logic Blackbox — hash, batch, seal

Project description

ghostseal

Lightweight audit client for Ghost_Logic Blackbox. Hash, batch, seal.

Every event gets a SHA-256 content hash, batched delivery to Blackbox, and automatic spill-to-disk when Blackbox is unreachable. Events are sealed into hash-chained GLCF capsules by Blackbox automatically.

Install

pip install ghostseal

Usage

from ghostseal import SealClient

client = SealClient(
    blackbox_url="https://blackbox.ghostlogic.dev:8443",
    api_key="your-blackbox-api-key",
    source="myapp",
)

# Emit an audit event
client.emit("myapp.user.login", {"user_id": "abc", "ip": "1.2.3.4"})

# Events are batched and flushed automatically every 30s
# Or flush manually:
client.flush()

# On shutdown:
client.close()

With spine

from spine import Core
from ghostseal import SealClient

def setup(c):
    c.register("audit", SealClient(
        blackbox_url="https://blackbox:8443",
        api_key="...",
        source="ghostrouter",
    ))
    c.boot(env="prod")

Core.boot_once(setup)

# Anywhere in your code:
Core.instance().get("audit").emit("ghostrouter.call.complete", {
    "model": "claude-sonnet",
    "latency_ms": 1200,
    "cost": 0.003,
    "prompt_hash": "sha256:9f3...",
})

How it works

your code → client.emit() → SealEnvelope (SHA-256 hashed)
                           → batch buffer (in memory)
                           → POST /api/v1/ingest (Blackbox)
                           → auto-sealed into GLCF capsule
                           → hash-chained, Merkle-verified, compressed

If Blackbox is down → spill to ~/.ghostseal/spill.jsonl
                    → client.drain_spill() when back up

Part of the GhostLogic SDK

maelspine  → config registry
ghostseal  → audit backbone (this package)
ghostrouter → LLM routing
ghostserver → MCP tools
ghostprompt → prompt management (coming)

License

Apache 2.0

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

ghostseal-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

ghostseal-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file ghostseal-0.1.0.tar.gz.

File metadata

  • Download URL: ghostseal-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for ghostseal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6649069390f9364788a2898aec687820da1656e7cb09ca28edcac8648e66e677
MD5 7f05d08b588c52ab3cae77e22f7ef78f
BLAKE2b-256 5cfde82ea06c2664daff8cc7abbb93365d6f340351571661546d7b5fbeaa0a4c

See more details on using hashes here.

File details

Details for the file ghostseal-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ghostseal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for ghostseal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0d0a6698db77dbe8d055fd578e68fd8b12082ce7b4daa0257b4e4ac46930ab7
MD5 abf72e485b70ce43e6df19a8d59a45fb
BLAKE2b-256 92f9a694290c2ee822043019783cc05ae39f301354b8b208abf7d008af08dbcc

See more details on using hashes here.

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