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.0.tar.gz (39.7 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.0-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tracectrl-0.3.0.tar.gz
  • Upload date:
  • Size: 39.7 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.0.tar.gz
Algorithm Hash digest
SHA256 804d26e46e541b76e613068d9f44eea02727ce9498fe8f4af647fda207a46db9
MD5 b6abe5cc5c6c9a90b842ffa77d264339
BLAKE2b-256 32db48150ad9b6ee9ac2b35d3ac1223758ca2742f79e3654892244b30e035be5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tracectrl-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 47.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50cafe2fca1b9c9ef78b541c4c1fd18ce2a4eed58313f45c405b834776630bfc
MD5 e7f76a5152b59ea84fa5a366a03ec418
BLAKE2b-256 07d5479a5e405cd9178efda2b2749564d5df41454f6de9e8d5b0b9ae3853cbbc

See more details on using hashes here.

Provenance

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