Skip to main content

Python SDK for Sector8 AI telemetry, alerts, and MCP guard installation

Project description

Sector8 SDK

PyPI version Python 3.8+ License: MIT

Python SDK for sending AI telemetry and security events to Sector8.

Sector8 is an execution-boundary security platform for AI systems. The production Guard Module is live at https://sdkapi.sector8.ai.

What this package is for

Use sector8-sdk when you want to:

  • send telemetry for LLM calls to Sector8
  • emit threat alerts and incident logs from your application
  • install the Sector8 MCP guard helper into a local project

This package is intentionally simple. The paid wedge is the live guard and decision service, not a large client-side framework.

Installation

pip install sector8-sdk

Optional extras:

pip install sector8-sdk[openai]
pip install sector8-sdk[anthropic]
pip install sector8-sdk[google]
pip install sector8-sdk[all]

Quick start

Set your credentials:

export SECTOR8_API_KEY="your-api-key"
export SECTOR8_CLIENT_ID="your-client-id"
export SECTOR8_BASE_URL="https://sdkapi.sector8.ai"

Send telemetry:

import sector8

client = sector8.setup(
    api_key="your-api-key",
    client_id="your-client-id",
)

client.log_llm_call(
    provider="openai",
    model="gpt-4o",
    tokens=150,
    cost=0.003,
    latency_ms=800,
    prompt="Summarize this contract.",
    completion="Here is the summary...",
)

You can also call the async methods directly:

import asyncio
import sector8


async def main() -> None:
    client = sector8.setup(api_key="your-api-key", client_id="your-client-id")
    await client.save_telemetry(
        provider="openai",
        model="gpt-4o",
        prompt="Classify this email",
        completion="Likely phishing",
        tokens_used=240,
        latency_ms=620,
        cost=0.0048,
        success=True,
        metadata={"route": "inbound-mail"},
    )
    await client.close()


asyncio.run(main())

Threat alerts and incidents

import sector8

client = sector8.setup(api_key="your-api-key", client_id="your-client-id")
client.alert_threat("prompt_injection", severity="High", description="Jailbreak attempt detected")
client.log_incident("Sensitive file request denied", severity="high", classification="policy_deny")

MCP guard helper

This package also ships a small CLI for installing the Sector8 guard MCP entry into a project:

sector8-guard install
sector8-guard version

The installer writes .claude/settings.json entries that point at the repo-local MCP stdio server and pass through:

  • SECTOR8_API_KEY
  • SECTOR8_CLIENT_ID

Runtime endpoints used by this SDK

  • Production API: https://sdkapi.sector8.ai
  • Telemetry ingest: POST /api/v1/telemetry
  • Threat alerts: POST /api/v1/threat-alerts
  • Incident logs: POST /api/v1/incident-logs

Secure host configuration

The SDK trusts only https://*.sector8.ai by default.

  • plain HTTP is rejected by default
  • arbitrary non-Sector8 hosts are rejected by default
  • local or mock testing requires explicit opt-in
client = sector8.setup(
    api_key="your-api-key",
    base_url="http://localhost:9876",
    allow_unsafe_base_url=True,
)

Use allow_unsafe_base_url=True only for deliberate local or test use.

Links

  • Homepage: https://sector8.ai
  • Production API: https://sdkapi.sector8.ai
  • Dashboard: https://app.sector8.ai
  • Repository: https://github.com/advicebytes/Sector8-MVP

Development notes

This package targets Python 3.8+ and is published as sector8-sdk on PyPI.

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

sector8_sdk-1.0.1.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

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

sector8_sdk-1.0.1-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file sector8_sdk-1.0.1.tar.gz.

File metadata

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

File hashes

Hashes for sector8_sdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a5ca1814a74df243ed6ba1ab05311b2c95cbb57a98a246895b16d389490646d5
MD5 87a92c3a547702a87a542d4e1bf96420
BLAKE2b-256 58da625a47fec78f613fe919fad9dccee99e6a5cb35817ba5fa0bb3a5e30f777

See more details on using hashes here.

File details

Details for the file sector8_sdk-1.0.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for sector8_sdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 824f0e73819bac92e50a47a3821e715016401796f43bcf32131b6f8a07c9ddb9
MD5 516b8134791663113a36808df1429231
BLAKE2b-256 f740a5fd7312b56dcc468798bc03975ff8b76f33d53782c21c5910e1b7808f01

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