Splyntra SDK - Agent observability & security, built on OpenTelemetry
Project description
Splyntra Python SDK
Unified observability and security for AI agents in Python. Built on OpenTelemetry, the Splyntra SDK captures every agent step, LLM call, and tool invocation as a structured trace — enriched with real-time risk scoring for leaked secrets, PII exposure, and prompt injection.
Installation
pip install splyntra
With framework auto-instrumentation:
pip install "splyntra[langgraph,openai]"
Available extras: langgraph, openai, openai-agents, crewai
Getting Started
Initialize once at application startup. The instrument parameter enables automatic tracing for supported frameworks — no per-call changes required.
from splyntra import Splyntra
Splyntra(
api_key="splyntra_dev_key",
project="my-app",
endpoint="http://localhost:4318",
framework="langgraph",
instrument=("langgraph", "openai"),
)
# Run your LangGraph / OpenAI agent as usual — spans are captured automatically.
To instrument separately (e.g., after configuring the client elsewhere):
from splyntra import instrument
instrument() # auto-detect all installed frameworks
instrument("langgraph") # or target a specific one
Manual Instrumentation
For custom agent, tool, and LLM functions, use decorators. Both sync and async functions are supported.
from splyntra import trace_agent, trace_tool, trace_llm
@trace_agent(name="support_agent", workflow="refund")
def run(query: str):
customer = read_customer("42")
return call_llm(query)
@trace_tool(name="crm.read")
def read_customer(id: str):
...
@trace_llm(model="gpt-4o", provider="openai")
def call_llm(prompt: str) -> dict:
# Return a dict with a "usage" key for token/cost analytics
...
Configuration
| Parameter | Default | Description |
|---|---|---|
api_key |
required | Splyntra API key (sent as Bearer token) |
project |
required | Project slug |
endpoint |
http://localhost:4318 |
Collector base URL |
environment |
development |
Deployment environment label |
service_name |
value of project |
OpenTelemetry service.name resource |
framework |
None |
Framework label shown on the Agents page |
redact_by_default |
True |
Strip secrets from spans before export |
instrument |
None |
Tuple of frameworks to auto-instrument |
Client-Side Redaction
High-confidence secrets (AWS keys, JWTs, bearer tokens, API keys) are stripped from span attributes before they leave your process. The collector applies a second pass on ingest as defence-in-depth.
Disable with redact_by_default=False (not recommended for production).
Supported Frameworks
| Framework | Extra name | Span mapping |
|---|---|---|
| OpenAI SDK | openai |
Chat completions → llm_call spans |
| LangGraph | langgraph |
Graph run → agent span, nodes → step spans |
| OpenAI Agents | openai-agents |
Runner.run → agent span |
| CrewAI | crewai |
Crew kickoff → agent, tasks → step, tools → tool_call |
Each instrumentor is a safe no-op when its target package is not installed.
For out-of-process platforms (Dify, n8n), see Integrations.
Evaluation
Run scored evaluations against the Splyntra evaluation service. The CLI exits non-zero on regression, making it suitable as a CI gate.
from splyntra import eval as ev
ev.push_dataset("support-qa", [{"input": "...", "expected_output": "..."}])
result = ev.run(dataset_id, results=[{"input": "...", "actual": "..."}], gate=True)
splyntra eval push --name support-qa --file dataset.jsonl
splyntra eval run --dataset <id> --file results.jsonl --gate
Governance
Request delegation decisions and record consequential actions to the immutable ledger:
from splyntra import authorize, log_action
decision = authorize(
"payments.refund",
agent_id="support_agent",
context={"amount": 80},
)
if decision["decision"] == "allow":
# proceed with action
...
elif decision["decision"] == "needs_approval":
# routed to human approval in the dashboard
...
log_action("refund", actor="support_agent", resource="order_42", metadata={"amount": 80})
Examples
python examples/quickstart.py # Decorator-based, framework-free
python examples/langgraph_quickstart.py # LangGraph end-to-end
python examples/crewai_quickstart.py # CrewAI crew
python examples/security_demo.py # Deliberately triggers security detections
License
Apache-2.0 — see LICENSE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file splyntra-1.1.0.tar.gz.
File metadata
- Download URL: splyntra-1.1.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47dc673503f3148cbde5e506ba433c3de3e71923fe46da4d98cb673451c84587
|
|
| MD5 |
3fdd5e52bee261c7aa356e0dced221e3
|
|
| BLAKE2b-256 |
0b444ac2763f425f968530468b67a505359259bbb5ba0eb5702ce2d71af262e1
|
Provenance
The following attestation bundles were made for splyntra-1.1.0.tar.gz:
Publisher:
release.yml on splyntra/splyntra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
splyntra-1.1.0.tar.gz -
Subject digest:
47dc673503f3148cbde5e506ba433c3de3e71923fe46da4d98cb673451c84587 - Sigstore transparency entry: 2022340228
- Sigstore integration time:
-
Permalink:
splyntra/splyntra@feba3230fe7d2c2cc6f90c4a5e1eecabf22cf22b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/splyntra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@feba3230fe7d2c2cc6f90c4a5e1eecabf22cf22b -
Trigger Event:
push
-
Statement type:
File details
Details for the file splyntra-1.1.0-py3-none-any.whl.
File metadata
- Download URL: splyntra-1.1.0-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7e0b211ddbe0ba3e2cc5fa3fabf46e65bfe85278eb315741a7c28dc19d4ed84
|
|
| MD5 |
89b0366cd88d8a0d552c4a2b92533c45
|
|
| BLAKE2b-256 |
3538a2ce095004f3076fecde81fdf5cfac80c9b2802d7907d35499d913644e15
|
Provenance
The following attestation bundles were made for splyntra-1.1.0-py3-none-any.whl:
Publisher:
release.yml on splyntra/splyntra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
splyntra-1.1.0-py3-none-any.whl -
Subject digest:
c7e0b211ddbe0ba3e2cc5fa3fabf46e65bfe85278eb315741a7c28dc19d4ed84 - Sigstore transparency entry: 2022340405
- Sigstore integration time:
-
Permalink:
splyntra/splyntra@feba3230fe7d2c2cc6f90c4a5e1eecabf22cf22b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/splyntra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@feba3230fe7d2c2cc6f90c4a5e1eecabf22cf22b -
Trigger Event:
push
-
Statement type: