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.1.tar.gz (11.6 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.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ghostseal-0.1.1.tar.gz
  • Upload date:
  • Size: 11.6 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.1.tar.gz
Algorithm Hash digest
SHA256 70a3b338cbc34f6474055c4fe53d31be783a52b20362391fa168f176969a4a57
MD5 9352c51daf039bcd1bd75f671c81d1fd
BLAKE2b-256 a029c882ac5dd33394ddd95529a8bbb6d0ded4950c3a1ec97fa44765b6fde3f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ghostseal-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7dcdf4775797e0489d3ac3ea584ef8d1f16f2efb983bf4134714f7ced004d328
MD5 c2ebc069e8163950a419da20f685217d
BLAKE2b-256 a4fc4c3aa9b3e7bf48dfdcccbe3a300de19b9e3a26c146c74da76898f5ae1df4

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