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.2.tar.gz (41.6 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.2-py3-none-any.whl (48.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tracectrl-0.3.2.tar.gz
  • Upload date:
  • Size: 41.6 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.2.tar.gz
Algorithm Hash digest
SHA256 c5dad20d57f5b35113488432ea297e8323d295012dc7097142cebe29034a31c3
MD5 3829ca54c5f284e03f38e8805ed8258a
BLAKE2b-256 c13ab9328770f76de789d1ca0696ff922cd259c108fb003698a944bc7ca43de3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracectrl-0.3.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: tracectrl-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 48.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 80ce4a76574442ce6f6cd6c93883d6acc0a9ce2637105e10174e0849770597ba
MD5 e9d9b1270343c4cb845dd5333c55477e
BLAKE2b-256 29446001c35a829d02de5dc60201b7bedacac25b821ecbf29d5af06c2dce9fb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracectrl-0.3.2-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