Skip to main content

Overview

Every span captured by TraceCtrl carries two layers of attributes:
  1. OpenInference attributes — set by the framework instrumentor (LLM calls, tool names, I/O values)
  2. TraceCtrl security attributes — set by the TraceCtrlSpanProcessor (agent identity, risk classification, session correlation)

TraceCtrl Security Attributes

These are the tracectrl.* attributes added to every span:
AttributeTypeDescription
tracectrl.agent.idstringUnique agent identifier. Derived from framework metadata or agent name.
tracectrl.agent.namestringHuman-readable agent name.
tracectrl.agent.rolestringAgent’s role or purpose (e.g., “Researcher”, “Writer”).
tracectrl.agent.frameworkstringDetected framework: langchain, crewai, agno, google_adk, strands.
tracectrl.session_idstringSession correlation ID. Groups related spans across a conversation.
tracectrl.caller.agent_idstringThe agent that triggered this span (for multi-agent delegation).
tracectrl.input.sourcestringInput provenance: user, agent, external, or memory.
tracectrl.tool.categorystringRisk category of the tool. See Tool Categories.
tracectrl.tool.targetstringTarget resource of the tool call (e.g., URL, file path).
tracectrl.memory.operationstringMemory operation type: read or write.
tracectrl.memory.store_idstringIdentifier of the memory/vector store.
tracectrl.memory.write_provenancestringOrigin of data being written to memory.
tracectrl.system_prompt_hashstringSHA-256 hash (first 16 hex chars) of the system prompt. Used for prompt drift detection.
tracectrl.span_sequenceintSequence number within the trace.

OpenInference Attributes

These are set by the underlying framework instrumentors:
AttributeTypeDescription
openinference.span.kindstringSpan type: AGENT, TOOL, LLM, CHAIN, RETRIEVER, EMBEDDING.
input.valuestringInput to the operation (prompt, query, etc.).
output.valuestringOutput from the operation (response, result).
llm.model_namestringModel identifier (e.g., gpt-4o, claude-sonnet-4-20250514).
llm.systemstringSystem prompt text.
llm.prompt_template.templatestringPrompt template if used.
tool.namestringTool function name.
tool.descriptionstringTool description string.
tool.parametersstringTool call parameters (JSON).
retrieval.documentsstringRetrieved documents (for retriever spans).

Schema Constants

Import attribute names as constants to avoid typos:
from tracectrl.schema import (
    TC_AGENT_ID,
    TC_AGENT_NAME,
    TC_TOOL_CATEGORY,
    TC_SESSION_ID,
    TC_INPUT_SOURCE,
    TC_SYSTEM_PROMPT_HASH,
    OI_SPAN_KIND,
    INPUT_VALUE,
    OUTPUT_VALUE,
    LLM_MODEL_NAME,
    TOOL_NAME,
)
The tracectrl.system_prompt_hash attribute enables prompt drift detection — if the hash changes between observations, the system prompt was modified. This is a key indicator for prompt injection attacks.