AgentTrace: Execution-Level Fingerprinting of Black-Box LLM AgentsAgentTrace: Execution-Level Fingerprinting of Black-Box LLM Agents
The authors propose AgentTrace, which injects probes into black-box agents and models their repair trajectories with a Markov chain, reporting 96.0% attribution accuracy under identity spoofing.
- The underlying model of a black-box LLM agent may be secretly replaced by the service provider (model spoofing), while system prompts mask semantic fingerprints and active watermarking conflicts with structured tool generation, making provenance verification difficult.
- AgentTrace offline-searches structurally ambiguous probes, injects the agent's rigid tool interface to induce tokenization-sensitive serialization failures, then models the multi-step repair trajectory with a Markov chain and performs attribution by log-likelihood.
- In the identity spoofing scenario with Q=50, overall attribution accuracy is 96.0%, versus 29.6% and 52.6% for the semantic baselines; after adding repair trajectories, accuracy within the Llama-3 family of variants sharing a tokenizer rises from 50.0% to 93.0%.
- The assumptions listed by the authors include: the target agent must execute external tools with strict schema validation, and the middleware must expose error feedback; middleware that strictly canonicalizes serialization may suppress tokenization artifacts; the transferability of probes to unseen model checkpoints is left for future work.
- Threat model
- Strict black-box setting: the auditor can query the agent and observe tool arguments, parser feedback, and final results, and cannot access weights, logits, or private prompts, but has local/API access to the reference models in the candidate set M; the adversary secretly replaces the underlying model M* and may modify the system prompt or decoding parameters (e.g., temperature) to conceal identity; the client-side orchestration O, tool schema T, parser, and retry logic remain fixed.
- Evaluated models
- GPT-4oLlama-3-8B-InstructLlama-3-70B-InstructMistral-7B-Instruct-v0.3Qwen-2.5-7B-InstructQwen-2.5-72B-Instruct
- Benchmarks
- 作者构建的 K=100 对抗探针库(Ktrain=50 画像探针、Ktest=50 留出探针)
- Metrics
- Attribution AccuracyMacro-F1Recall
The researchers propose AgentTrace, an active framework that identifies the base model behind a black-box LLM Agent through observable execution trajectories, achieving 96.0% attribution accuracy under adversarial identity disguise. The method injects structurally ambiguous probes into the Agent, triggering tokenization-sensitive serialization failures at strict tool interfaces; the initial failure allows coarse-grained discrimination among different model families. The time series of subsequent repair operations then reveals model-specific fine-grained recovery behavior, and the authors model these multi-step trajectories with lightweight Markov chains. The paper claims that sequential repair modeling can distinguish same-family variants sharing the same tokenizer (e.g., Llama-3 8B/70B), clearly outperforming orderless behavior statistics, and remains robust to prompt obfuscation and temperature scaling.
Paper analysis
What problem does this paper attempt to solve?
On how to verify the provenance of an LLM agent's underlying model under black-box, identity-spoofing conditions, the authors propose the execution-level attribution framework AgentTrace.
Core question: how to verify the true underlying model behind an autonomous LLM agent exposed as an opaque black-box service.
- Scenario and motivation: The authors state that agents are often hidden behind APIs, system prompts, and orchestration layers, and as they connect to critical infrastructure, verifying provenance becomes a security requirement; a prominent threat is model spoofing, where a provider secretly wraps a substitute model and impersonates a proprietary model.
- Shortcomings of existing methods: The authors argue that passive fingerprinting relying on n-grams, perplexity, or stylometry is defeated when agent prompts rewrite the output; active watermarking involves a utility-security trade-off in structured generation such as JSON, and probabilistic perturbations break the strict grammar required by tools.
- Core observation: The authors empirically observe that differences in how different tokenizers segment structurally ambiguous identifiers produce instability during serialization (e.g., extra whitespace), which is amplified by rigid tool parsers into deterministic execution failures; initial failures provide a cross-family coarse-grained signal, and the temporal order of subsequent repair operations provides an intra-family fine-grained signal.
- Proposed in the paper: AgentTrace, an active attribution framework that injects structurally ambiguous probes to induce tokenization-sensitive serialization failures and models multi-step repair trajectories with a lightweight Markov chain; the authors also construct a probe benchmark.
- Threat model (strict black-box):
- Auditor capabilities: Can query the agent and observe tool arguments, parser feedback, and final results; cannot access weights, logits, or private prompts; has local/API access to reference models in the candidate set M.
- Adversary capabilities: Secretly replaces the underlying model M*, and can modify system prompts or decoding parameters (e.g., temperature) to conceal identity.
- Orchestration scope: Client-side orchestration O, tool schema T, parser, and retry logic remain fixed, simulating a scenario where the application infrastructure is intact but backend requests are maliciously redirected.
What related research exists?
Related work falls into three groups: passive fingerprinting and active watermarking, active probing attribution, and tokenization and agent vulnerabilities; the baselines are Stylometry and Cross-Perplexity.
LLM fingerprinting and watermarking
- Passive fingerprinting such as Tay et al. (2020) and DetectGPT (Mitchell et al., 2023) exploits statistical traces such as n-gram frequencies or log-probability curvature; the paper notes that these methods assume outputs reflect the original distribution, whereas in agent workflows system prompts and persona conditioning act like a high-pass semantic filter that masks these statistical signals (Uchendu et al., 2020; Wang et al., 2023).
- Active watermarking such as Kirchenbauer et al. (2023) and Zhao et al. (2024) embeds detectable patterns by perturbing token probabilities; the paper notes that such perturbations break the strict syntactic constraints required by external tools in structured domains such as code or JSON, making them difficult to deploy reliably in task-oriented agents (Lee et al., 2024).
Active probing and model attribution
- LLMMap (Pasquini et al., 2025) formulates attribution as a semantic query process, recovering the model's decision boundary from response behavior; the paper notes that such methods operate in semantic space and are sensitive to prompt engineering, alignment modifications, and output post-processing (Gudibande et al., 2024; Wang et al., 2023).
- The paper additionally notes in the experimental section: active fingerprinting methods such as LLMMap target conversational text interfaces and do not define an attribution protocol on schema-constrained execution trajectories; a faithful adaptation would require changing their observable interface and probing procedure, so they were not included as agent baselines in this paper.
Tokenization and agent vulnerabilities
- Singh and Strouse (2024) and Petrov et al. (2023) find that tokenizer differences cause performance degradation in multilingual and code generation tasks.
- Zhang et al. (2024)'s glitch tokens, ArtPrompt (Jiang et al., 2024), and Geh et al. (2025) exploit atypical tokenization to trigger anomalous outputs, bypass safety alignment, or evade detection; the paper notes that these works mainly focus on safety escape or jailbreak, whereas this paper examines whether tokenization artifacts can be systematically used for model attribution.
Baselines and benchmark: the experiments compare two semantic baselines—Stylometry (a traditional classifier based on lexical and n-gram features) and Cross-Perplexity (attributing the output to the candidate model with the lowest normalized perplexity); evaluation uses the authors' self-built library of K=100 adversarial probes.
The authors position this paper as a shift from semantic fingerprinting to execution profiling: rather than querying text boundaries, it seeks discriminative information in multi-step execution trajectories.
How does the paper address this problem?
AgentTrace has three stages: offline probe optimization, online execution injection, and Markov chain-based temporal trajectory discrimination.
AgentTrace conceptualizes active attribution as finding the optimal probe s* that maximizes the mutual information between the candidate model identity M and the induced trajectory τs: s∗ = argmaxs I(M; τs). Since this expression cannot be estimated directly under black-box conditions, the authors use the empirical execution failure probability as a practical surrogate objective. The overall process is a three-stage pipeline.
Problem setting and formalization
- A tool-augmented agent is defined as A = ⟨M*, P, T, O⟩, where M* is the underlying foundation model, P is the system instruction, T is the external tool, and O is the orchestration mechanism (including the parser, schema validator, and retry logic).
- Assuming the chain of thought is hidden, an input probe s produces an externally observable trajectory τs = [(a1, o1), …, (aL, oL)], where at is the serialized tool argument and ot = (bt, et) is the deterministic observation, bt ∈ {Success, Error}, and et is the exception category (e.g., JSONDecodeError).
- Attribution task: given a candidate set M = {M1, …, MN} and a set of probe-induced trajectories Q, the auditor infers the hidden model M̂ = F(Q) ∈ M.
Stage I: Offline probe optimization
- The core surrogate metric is the execution gap, i.e., the probability of a structural or schema violation: Gap(M, s) = Pry ∼ GM[Parse(y) = Error ∨ ValidT(y) = Error]; the authors state that the rigid parser converts latent generation instability into categorical outcomes without requiring access to logits.
- Define the normalized token boundary distance Dtok(Mi, Mj; s) = 1 − |BMi(s) ∩ BMj(s)| / |BMi(s) ∪ BMj(s)|, where BM(s) is the set of byte offsets at which the tokenizer TokM places boundaries on the string s.
- The joint surrogate score J(s) = ∆target(s) + λe·∆exec(s) + λt·∆tok(s) balances the target validation margin, the cross-candidate execution gap variance, and pairwise tokenizer diversity; the search is constrained by Gap(Mc, s) ≤ ϵ and a surrogate-model average failure rate of at least γ, and is optimized with mutation-based beam search.
Stage II: Online execution injection
- At audit time, the selected probe is injected through structured tool arguments in order, and the instruction template requires the model to reproduce the probe value character by character and not to summarize (the full template is in Section 3.3).
- If the initial call fails, the orchestration framework appends the error feedback to the context and prompts the model to generate a corrected call until it succeeds or the retry limit is reached.
Stage III: Temporal trajectory discrimination
- A trajectory is represented as zτ = ⟨E, Rseq⟩, where E is the initial outcome and Rseq is the ordered repair sequence; it is factorized as P(zτ | M) = P(E | M)·P(Rseq | E, M), where the repair sequence is modeled as a first-order Markov chain whose probabilities are estimated from offline profiles with add-one Laplace smoothing.
- The final prediction sums the log-likelihoods of the Q trajectories and normalizes by dividing by max(1, Lq − 1); the authors state that this normalization prevents long retry trajectories from dominating the attribution score.
What experiments did the paper conduct?
Evaluated on 6 models with a self-built library of 100 probes: AgentTrace overall accuracy 96.0%, semantic baselines 29.6%/52.6%, with within-family discrimination and robustness experiments also conducted.
Experimental Setup
- Models under test: GPT-4o as the target identity being impersonated (ground truth); the substitute models (spoofers) are Llama-3-8B-Instruct, Llama-3-70B-Instruct, Mistral-7B-Instruct-v0.3, Qwen-2.5-7B-Instruct, Qwen-2.5-72B-Instruct (Table 1).
- Deployment: The open-source substitute models are deployed locally via vLLM with generation temperature T = 0.1 (except for robustness tests); GPT-4o is accessed via the official API; all models are integrated into the same LangChain-based ReAct orchestration stack, equipped with a strict JSONAgentOutputParser, interacting with three rigid external tools (a typed JSON API, a regex-constrained filesystem interface, and a Python code executor).
- Spoofing scenario: Each substitute model is injected with a deceptive system prompt requiring it to claim to be GPT-4o and strictly conceal its true identity.
- Data: Offline search constructs K = 100 adversarial probes, split into Ktrain = 50 profiling probes (to estimate the Markov transition matrix) and Ktest = 50 held-out probes (final test).
- Baselines and ablations: Two semantic baselines, Stylometry and Cross-Perplexity; two ablations, Initial Outcome (using only the first parsed result) and Bag-of-Operations (counting repair actions but discarding temporal order).
- Protocol: Main results use a query budget Q = 50; each candidate model undergoes 100 independent trials, each randomly drawing Q probes without replacement, with attribution per Equation 8; report the mean of accuracy, macro-F1, and recall.
Main Results
According to Table 2 (under adversarial identity spoofing, held-out probes, Q = 50):
Swipe horizontally to read the table
Underlying model Stylometry Recall Cross-Perplexity Recall Bag-of-Operations Recall AgentTrace Recall GPT-4o (Target Identity) 94.0% 88.0% 92.0% 98.0% Llama-3-8B-Instruct 18.0% 42.0% 72.0% 92.0% Llama-3-70B-Instruct 24.0% 46.0% 74.0% 94.0% Mistral-7B-Instruct 12.0% 38.0% 78.0% 98.0% Qwen-2.5-7B-Instruct 14.0% 48.0% 70.0% 96.0% Qwen-2.5-72B-Instruct 16.0% 54.0% 76.0% 98.0% Overall accuracy / Macro-F1 29.6% / 0.19 52.6% / 0.44 77.0% / 0.73 96.0% / 0.96 - The authors state that the deceptive prompts cause the substitute models to imitate GPT-4o in visible style, and both semantic baselines exhibit severe false acceptance; semantic text features are easily overwritten by system instructions.
- The authors state that AgentTrace combines the coarse-grained signal of initial tokenization-sensitive crashes with the fine-grained signal of ordered repair trajectories, maintaining high accuracy under identity confusion.
- The authors state that the gap between Bag-of-Operations (77.0%) and AgentTrace (96.0%) shows that explicitly modeling the temporal order of repair transitions provides a stronger fingerprint than merely counting unordered repair actions.
Mechanism Validation and Query Efficiency
- Tokenization sensitivity: Spearman correlation analysis on the optimized probe library shows that token boundary distance Dtok is positively correlated with the difference in cross-family model execution gaps (ρ = 0.54, p < 0.01); the authors state this provides direct empirical evidence that parsing anomalies are sensitive to the underlying tokenization mechanism.
- ∆tok ablation: Removing the ∆tok term from the probe optimization function reduces overall attribution accuracy to 84.5%; the authors state this confirms that explicitly optimizing token-level divergence is crucial for discovering high-quality probes.
- Query budget: According to Table 3, for Q ∈ {1, 3, 5, 10, 50} the accuracy is 65.2%, 78.4%, 86.5%, 92.8%, 96.0% respectively; the authors state that Q = 10 already reaches 92.8%, making the API query budget practical and low-cost.
Intra-family Fine-grained Attribution (RQ2)
- Problem: Llama-3-8B and 70B share the same tokenizer, and Qwen-2.5-7B and 72B share the same vocabulary; probes often induce identical initial execution failures on intra-family variants, so the tokenization-execution gap alone is insufficient for fine-grained attribution.
- Results: According to Table 4, with Initial Outcome only, the intra-family accuracy for both the Llama-3 pair and the Qwen-2.5 pair is 50.0% (chance level), with an overall 66.8%; after adding the repair trajectory (Markovian repair trajectory), the Llama-3 pair rises to 93.0% and the Qwen-2.5 pair to 97.0%, with an overall 96.0%.
- Transition graph: Figure 2 presents the empirical repair transition graph for the Llama-3 variants (edge thickness corresponds to transition probability); the authors state that 70B more often applies structured operations (e.g., regex escaping) leading to success, while 8B relies on local modifications (e.g., argument truncation) and often falls into retry loops.
Robustness (RQ3) and Case Study
- Prompt confusion: Figure 3(a) compares three system prompts: Default, Persona-Cloak, Format-Enforcer; the authors state that the semantic baselines drop substantially under the two confusing prompts, while AgentTrace maintains over 94% attribution accuracy under all prompt settings (the values annotated in the figure include 98.5, 96.0, 94.5, but the panel text is misaligned in conversion and cannot be matched one-to-one to specific settings).
- Temperature scaling: Figure 3(b) tests under T ∈ {0.1, 0.5, 0.8}; the authors state that Markov trajectory modeling absorbs generation noise, maintaining robust attribution accuracy at T = 0.8 (annotations such as 96.0, 94.5, 91.2 are visible in the figure, likewise not matchable one-to-one to specific temperatures).
- Case study: Figure 4 shows an adversarial identifier case containing a zero-width joiner (U+200C): GPT-4o tends to preserve the original Unicode boundary and execute successfully, Llama-3-8B tends to truncate the argument and fall into retry failures, and Llama-3-70B more often applies structured JSON escaping leading to recovery; the authors state this shows that the temporal order of repair operations provides a stronger fingerprint than static text features.
What are some points that can be further explored?
The authors list four operational assumptions and probe transferability as a future direction; the experiments cover 6 models, 100 probes, and 100 trials per model.
Limitations and future directions noted by the authors
- Reliance on strict schema validation: the framework requires the target agent to execute external tools with strict schema validation (Limitations section).
- Reliance on informative error feedback: temporal trajectory discrimination assumes the agent middleware exposes informative error feedback; highly restrictive environments that terminate the session on a single failure may limit the observable repair trajectories (Limitations section).
- Reliance on imperfect serialization fidelity: adaptive middleware that enforces canonical serialization (e.g., applying json.dumps() or aggressively stripping invisible Unicode characters) may partially suppress tokenizer-induced artifacts (Limitations section).
- Probe transferability remains to be studied: the authors state that offline probe optimization achieves high accuracy on the evaluated models, and future work must study the transferability of these probes to unseen model checkpoints to mitigate overfitting to specific model characteristics (Limitations section).
Experimental coverage
- There are 6 models under test: GPT-4o (target identity) and 5 open-source substitute models (Llama-3 8B/70B, Mistral-7B-Instruct-v0.3, Qwen-2.5 7B/72B), all integrated into the same LangChain ReAct orchestration stack and three rigid tools (Section 4.1).
- Evaluation uses the authors' self-built library of K = 100 probes (50 profiling / 50 test), the main results use a query budget Q = 50, and each candidate model has 100 independent trials (Section 4.1).
- Robustness evaluation covers three system prompt configurations (Default, Persona-Cloak, Format-Enforcer) and three generation temperatures (T ∈ {0.1, 0.5, 0.8}) (Section 4.4).
- The comparison baselines are two semantic methods, Stylometry and Cross-Perplexity; the paper states that active fingerprinting methods such as LLMMap were not included as baselines because their interfaces are not equivalent (Section 4.1).
- The paper does not report the specific values of λe, λt, ϵ, γ in probe optimization, nor confidence intervals or variance for each trial.
Summarize the main content of the paper
AgentTrace uses execution trajectories rather than semantic outputs for model attribution, reporting 96.0% accuracy under identity spoofing, and can distinguish within-family variants that share a tokenizer.
A paper on provenance verification for black-box LLM agents, targeting the model spoofing threat (a provider secretly replacing the underlying model while passing it off as a proprietary model). The authors argue that semantic fingerprints can be overwritten by system prompts and that active watermarks conflict with structured tool generation, so they turn to execution-level signals.
- Method: AgentTrace searches offline for structurally ambiguous probes, injecting rigid tool interfaces to induce tokenization-sensitive serialization failures; it uses initial execution results for coarse cross-family separation, then models multi-step repair trajectories with a first-order Markov chain for fine-grained within-family discrimination, attributing by normalized log-likelihood.
- Main results: under adversarial identity spoofing at Q = 50, overall attribution accuracy is 96.0% and macro-F1 0.96, while the semantic baselines Stylometry and Cross-Perplexity reach only 29.6% and 52.6% (Table 2).
- Within-family discrimination: for Llama-3 8B/70B and Qwen-2.5 7B/72B, which share tokenizers, within-family accuracy using only initial results is 50.0%, rising to 93.0% and 97.0% respectively after adding repair trajectories (Table 4).
- Efficiency and mechanism: at Q = 10 accuracy already reaches 92.8% (Table 3); the Spearman correlation between token boundary distance and execution gap difference is ρ = 0.54 (p < 0.01).
- Robustness: the authors state that accuracy remains above 94% under Persona-Cloak and Format-Enforcer prompt obfuscation, and remains robust under temperature scaling at T = 0.8 (Figure 3).
- Authors' conclusion: execution and error-recovery dynamics provide a practical and promising signal for auditing the provenance of black-box agent systems; the authors also acknowledge that the framework relies on strict schema validation and informative error feedback, and leave the transferability of probes to unseen model checkpoints for future work.