TACIT

Detecting harmful agent trajectories from LLM internal states

  • Agent safety
  • Guard models
  • Internal states

Difan Jiao · Ashton Anderson

TACIT overview: two forms of trajectory risk, internal-state readouts, performance, and efficiency.

Harmful content and unsafe tool use

An agent trajectory can be unsafe because it contains harmful content or because a tool call conflicts with its authorization, schema, or preceding context.

Harmful content

The risk is expressed directly in the request or action.

User

“Issue this oxycodone prescription—no diagnosis needed.

Agent × tool send_approval(rx)

Unsafe tool use

The risk depends on the action’s relation to the preceding interaction.

User

“Reconcile this invoice from Acme—review only.

Agent × tool pay_invoice(“Acme”, $500)

Mechanistic findings

We use matched trajectory pairs to isolate each risk, then compare the guard’s output with what remains readable in its internal states.

≈0

Cross-risk direction similarity

The directions for harmful content and unsafe tool use remain close to orthogonal through most layers. Same-risk split halves reach 0.81 similarity in Qwen and 0.87 in Llama.

Unsafe-tool-use rank accuracy reaches 0.98 inside the corresponding general-purpose backbones, even though all three evaluated guard outputs remain at or below chance.

Method: trajectory safety from internal states

TACIT renders the full trajectory with a frozen LLM's chat template, including the system prompt, tool schemas, message roles, and turn order. One forward pass provides the hidden states for the readout.

Probe

Validation selects a layer, pooling choice, and L2-regularized logistic probe.

Ensemble

The ensemble combines several fitted probes into one trajectory-level safety score.

Multi-layer

The multi-layer readout selects salient dimensions across layers and integrates them with a lightweight classifier.

Experiments and results

We train TACIT on the pooled training portions of six trajectory-safety benchmarks, select the readout on validation folds, and evaluate once on the held-out test portions.

86.2best mean macro-F1
+25.7over the strongest evaluated guard
6 / 6benchmarks where the plain probe leads
87.0after fine-tuning + TACIT
TACIT and open guard checkpoints across six benchmarks TACIT reaches the highest mean macro-F1 and outperforms every evaluated guard on every benchmark. TACIT reaches the highest mean macro-F1; complete values appear below.

Even the plain TACIT probe scores above every evaluated guard on all six benchmarks. The Multi-layer readout reaches 86.2 mean macro-F1 on Qwen3-4B, compared with 60.5 for AgentDoG. On AgentDojo, it reaches 76.9; the strongest evaluated guard reaches 37.7.

Comparison with full fine-tuning

With the same backbones, training pool, and held-out test split, the frozen TACIT readout is on par with full safety fine-tuning. Applying TACIT after fine-tuning improves both backbones further.

Qwen3-4B
Frozen TACIT86.2
Full fine-tuning84.2
Fine-tuning + TACIT86.5
Llama-3.1-8B
Frozen TACIT85.4
Full fine-tuning85.8
Fine-tuning + TACIT87.0
View full benchmark tables

Open guard checkpoints and frozen TACIT readouts

SystemR-JudgeTraceSafeATBenchASSEBenchOASAgentDojoMean
Qwen3Guard-4B32.234.736.843.638.215.833.6
LlamaGuard3-8B66.348.638.960.635.921.145.2
AgentDoG-4B92.744.763.381.443.337.760.5
TACIT · Qwen · Probe95.077.593.585.267.965.180.7
TACIT · Qwen · Ensemble97.088.795.088.572.071.085.4
TACIT · Qwen · Multi-layer97.086.594.589.872.776.986.2
TACIT · Llama · Probe98.078.690.088.069.066.681.7
TACIT · Llama · Ensemble97.090.193.588.772.768.885.1
TACIT · Llama · Multi-layer97.089.695.088.569.872.285.4

Matched-data fine-tuning comparison

BackboneMethodR-JudgeTraceSafeATBenchASSEBenchOASAgentDojoMean
Qwen3-4BSFT94.989.692.888.565.774.084.2
+ Probe94.389.792.589.567.872.084.3
+ Ensemble96.791.894.289.672.573.886.4
+ Multi-layer96.792.694.189.669.875.986.5
Llama-3.1-8BSFT96.595.094.189.861.478.285.8
+ Probe96.293.794.689.064.978.986.2
+ Ensemble96.094.995.289.365.777.386.4
+ Multi-layer97.095.194.488.766.080.687.0

Training and inference efficiency

TACIT fits small readouts on saved activations, so no gradient passes through the backbone. At inference, one forward pass produces the verdict without decoding tokens.

2,561parameters in one probe
0.36GPU-hours to train the probe
40 msdetection latency
0decoded tokens

Trainable parameters

A Qwen3-4B probe has 2,561 parameters, compared with 4.0 billion for full fine-tuning. The Ensemble uses 67K, and one Multi-layer aggregate uses about 3M.

Training time

The Probe takes 0.36 GPU-hours, the Ensemble 0.42, and the Multi-layer readout 0.69, compared with 2.11 for full fine-tuning.

Detection latency

TACIT takes 40 ms per trajectory, compared with 53 ms for AgentDoG and 215 ms for Qwen3Guard.

Performance by layer

Validation macro-F1 peaks at 80.9 at layer 22 and falls to 79.1 at the final layer. Stopping at layer 22 skips 14 of 36 layers; the truncated Multi-layer readout retains 85.3 macro-F1, compared with 86.2 at full depth.

Validation macro-F1 by layer, compared with TACIT Multi-layer and full safety fine-tuning.