Skip to main content

Spctre Odysseus Adapter

spctre-odysseus provides a Spctre middleware adapter for Odysseus runtimes that support the ToolMiddleware protocol:

async def before_call(self, tool_name: str, args: dict, ctx: dict) -> dict | None: ...

Install

pip install spctre-odysseus

For local development:

pip install -e ".[dev]"
python -m pytest tests/ -x

Usage

from spctre_odysseus import SpctreOdysseus

spctre = SpctreOdysseus(
    api_key="spctre_api_key",
    base_url="https://api.spctre.example",
    agent_id="agent_123",
    tenant_id="tenant_123",
    workspace_id="workspace_123",
    environment="production",
)

framework.add_middleware(spctre)

Before each tool call, the adapter posts to Spctre's /evaluate endpoint with Authorization: Bearer {api_key}. ALLOW, WARN, and ESCALATE decisions return None so Odysseus proceeds. DENY returns:

{"blocked": True, "reason": "policy reason"}

Set dry_run=True to skip all network calls and allow every tool call.

Evidence

After evaluation, the adapter emits evidence to /ingest/evidence in a fire-and-forget task. Evidence ingest errors are swallowed and do not change the tool-call decision.

Evidence records include:

  • runtimeTarget.stack = "ODYSSEUS"
  • runtimeTarget.adapter = "spctre-odysseus"
  • agentId, tenantId, workspaceId, and environment from constructor config
  • connector from ctx["connector"] or inferred from tool_name
  • action from ctx["action"] or tool_name
  • triggerKind from ctx.get("trigger_kind", "interactive")
  • parentAgentId from ctx.get("parent_agent_id") when present
  • rawEvidence.source = "odysseus.before_call"
  • raw tool call context under rawEvidence.toolName, rawEvidence.args, and rawEvidence.ctx

Download files

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

Source Distribution

spctre_odysseus-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

spctre_odysseus-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spctre_odysseus-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spctre_odysseus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4858562d82d05c3741b9604282cffea0d4449c5169e7a9df1c0c8ebeebf0504e
MD5 4258babff60aa463401ec024f0d29daa
BLAKE2b-256 04d5afa63ea365f5df237547af76bdf7e458ebf0ea293a3b25d7efc3e8c6d11f

See more details on using hashes here.

Provenance

The following attestation bundles were made for spctre_odysseus-0.1.0.tar.gz:

Publisher: release-python.yml on getspctre/spctre

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

File details

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

File metadata

File hashes

Hashes for spctre_odysseus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a36da42b0f7baa05f8feba7c2d0fd0a0960ffe0a530a7df870978f1968b71d5
MD5 9967b58cf1312a7a2cfea51a9faa14bc
BLAKE2b-256 834d433a09d3edb40ef0da87f2d3ebf00a381c3dde417fa7b0647b663fbd0e7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spctre_odysseus-0.1.0-py3-none-any.whl:

Publisher: release-python.yml on getspctre/spctre

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