Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

spot-sdk-python

The SDK for writing plugins of SPOT, the Spear-Phishing Overwatching Tool: analyzers, context providers, mail retrievers and responders.

SPOT runs each plugin as a container and calls its /internal/* routes with the plugin's own token. This package holds what SPOT's core and its plugins share:

  • the contract (Pydantic models): the email view, verdicts and signals, workflow policies, results, and the plugin manifest with its OCI labels;
  • the parser core runs on every message at intake (spot_sdk.mime.parse), bounded against hostile input, which records what mail clients may read differently as anomalies;
  • the plugin runtime: create_plugin_app builds the FastAPI app with the routes core calls, token-checked; PluginSettings reads the token and secrets from /run/secrets and the settings from the environment;
  • the clients: SpotClient (ingest, message content, results), KnowledgeClient (the Knowledge Store) and LLMClient (OpenAI-compatible chat models, with the email kept apart from the instructions as untrusted data);
  • test helpers: view_from_eml, make_view, FakeSpot, FakeKnowledgeClient, FakeLLM and assert_contract.

Install

pip install spot-sdk-python==2.0.0

Python 3.11 to 3.15. Version 2 implements plugin contract 2, for SPOT 2.0.

An analyzer

from spot_sdk import (
    AnalyzerVerdict,
    AnalyzeRequest,
    Egress,
    Manifest,
    PluginKind,
    PluginSettings,
    Signal,
    VerdictClass,
    create_plugin_app,
)
from spot_sdk.signals import AUTH_DMARC_FAIL

MANIFEST = Manifest(
    id="analyzer-dmarc",
    version="1.0.0",
    kind=PluginKind.ANALYZER,
    egress=Egress.NONE,
)


def analyze(request: AnalyzeRequest, settings: PluginSettings) -> AnalyzerVerdict:
    failed = [
        result
        for result in request.email.authentication
        if result.method == "dmarc" and result.result == "fail"
    ]
    if not failed:
        return AnalyzerVerdict(verdict=VerdictClass.BENIGN, score=10, confidence=60)
    return AnalyzerVerdict(
        verdict=VerdictClass.SUSPICIOUS,
        score=70,
        confidence=80,
        signals=[Signal(name=AUTH_DMARC_FAIL, weight=60, evidence="dmarc=fail")],
    )


app = create_plugin_app(MANIFEST, PluginSettings, analyze=analyze)

Serve it with uvicorn analyzer_dmarc:app --host 0.0.0.0 --port 8000, and test it with spot_sdk.testing.assert_contract(app, "tests/phish.eml", token=...).

Documentation

License

Apache License 2.0.

Metadata

Release files for spot-sdk-python 2.1.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spot-sdk-python 2.1.0b2
File Size Uploaded Provenance
spot_sdk_python-2.1.0b2.tar.gz 116.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for spot-sdk-python 2.1.0b2
File Interpreter ABI Platform
spot_sdk_python-2.1.0b2-py3-none-any.whl Python 3 none any Details

Total release size: 250.4 kB

Release files / spot_sdk_python-2.1.0b2.tar.gz

Download URL spot_sdk_python-2.1.0b2.tar.gz
Size 116.0 kB
Tags Source
SHA-256 checksum
How to use checksums
68a51191454c059ff99d64236ae4134f752cca766aeddc0e66d388b32d7b7bc3
BLAKE2b-256 checksum
How to use checksums
1f9afe54ad03a779229d85f632f8abd8171d831a0d11c88c37741599aa85ce89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / spot_sdk_python-2.1.0b2-py3-none-any.whl

Download URL spot_sdk_python-2.1.0b2-py3-none-any.whl
Size 134.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab99c63d20722fb54b3be56f1b9492b0d5915100ee7a65352ef88efe34128c8a
BLAKE2b-256 checksum
How to use checksums
56ae8b941763c6ee4d3d0ae379613bdd569d2eea3ba9aca1672c6fc7a6c61377
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for spot-sdk-python 2.1.0b2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page