Skip to main content

TraceCtrl SDK — agentic AI security observability

Project description

TraceCtrl SDK

Security observability and runtime guardrails for agentic AI. TraceCtrl instruments your agents with OpenTelemetry, captures every LLM call and tool invocation as security-enriched spans, and streams the trace + guardrail violations to the TraceCtrl dashboard in real time.

Install

pip install tracectrl

For framework integrations:

pip install tracectrl-instrumentation-strands   # AWS Strands
pip install tracectrl-instrumentation-agno      # Agno

Quickstart

import tracectrl
from tracectrl.instrumentation.strands import StrandsInstrumentor

# Configure once at startup — points the SDK at your TraceCtrl engine
tracectrl.configure(
    service_name="my-agent",
    endpoint="http://localhost:4317",
)

# Auto-instrument Strands (or replace with the instrumentor for your framework)
StrandsInstrumentor().instrument()

# Your existing agent code — no changes needed

Guardrails

Two guardrail providers, designed to coexist on the same agent:

1. Built-in LLM judge — declarative guardrails evaluated by a Bedrock OR Gemini model (auto-detected from the judge_llm you pass in):

from tracectrl.guardrails import Guardrail, wrap_agent_with_guardrails

no_pii_leak = Guardrail(
    name="no_pii_leak",
    description="Block agent responses containing personally identifiable info.",
    judge_prompt="Does the following response contain PII?\n\n{output}",
    judge_llm=bedrock_model,
    severity="high",
)

wrap_agent_with_guardrails(my_agent, [no_pii_leak])

2. TraceCtrl Guards (Protector Plus) — explicit checks against an external LLM firewall covering prompt injection, PII, content moderation, vector similarity, keywords/regex, and system-prompt leakage:

import tracectrl

with tracectrl.guard():
    tracectrl.check_input(user_message)
    response = my_agent(user_message)
    tracectrl.check_output(str(response))

Configure the Protector Plus endpoint and per-domain API key in the TraceCtrl dashboard's Settings page. Calls are async fire-and-forget — they emit OpenTelemetry evaluation spans without blocking the LLM call. Both decisions (pass / fail) show up in the trace tree and the dashboard's Guardrails page, with failures streamed as live alerts.

Tagging agents

from tracectrl import tag_agent

tag_agent(my_agent)   # reads agent.system_prompt + agent.name automatically

Identity shows up on the dashboard's Agents page.

Links

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

tracectrl-0.3.1.tar.gz (41.4 kB view details)

Uploaded Source

Built Distribution

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

tracectrl-0.3.1-py3-none-any.whl (48.8 kB view details)

Uploaded Python 3

File details

Details for the file tracectrl-0.3.1.tar.gz.

File metadata

  • Download URL: tracectrl-0.3.1.tar.gz
  • Upload date:
  • Size: 41.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tracectrl-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8561c98e583b0086e950c740980fbcf1eb166182355433b25d2036e06befaa0c
MD5 cfcdd9dede8066a65098b25077bcfa10
BLAKE2b-256 2903854d207a0565c8041bd277643e8d8f3ae6b92157c345e546dcc58d33ed11

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracectrl-0.3.1.tar.gz:

Publisher: pypi-cd.yml on tracectrl/tracectrl

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

File details

Details for the file tracectrl-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: tracectrl-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 48.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tracectrl-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57ead3f23a600662c7dec4022325f3117f9f3653bbfdff635afb6f3f815e5ecb
MD5 e1994c477be202272957dde6e27f53fb
BLAKE2b-256 3a0abaaf0588c485e757ce7f028767b8c232dff55420c85e854badec744085d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracectrl-0.3.1-py3-none-any.whl:

Publisher: pypi-cd.yml on tracectrl/tracectrl

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