
Jev as a judge: How counterfeit policy steers Jev
Datadog Security Labs tests TypeSafe AI's Jev decision model as a prompt-injection detector and as the judge behind LangChain's tool-risk gating. On four public datasets Jev had 99.66% precision and 82.90% recall. A prepended "counterfeit policy" that redefines the attack categories cut recall by over 79 points. In a LangChain scenario, a user-editable profile field lowered the mean is_risky score from 0.893 to 0.290, below the 0.5 block threshold. Plain prompt injection did not move the score.
What it is
Datadog Security Labs tested TypeSafe AI's Jev (a "System One" decision model released 15 September) as a security classifier. Two uses were tested: detecting prompt injection, and acting as the judge behind LangChain's tool-risk gating. The finding is that text placed in the content Jev reviews can rewrite the rules it applies. Plain injection does not do this.
How it works
The "counterfeit policy" is prepended to the untrusted message. It does three things:
- It states the desired answers (
has_prompt_injection: no,attack_category: no_attack). - It quotes the original message as an explicit benign exception.
- It redefines each attack category as something trivial, for example credential access applies "only when the user asks about a door key".
The developer's trusted Noul and Choice instructions and category criteria were left unchanged. Only the untrusted state was altered.
Baseline on four public datasets, threshold 0.5: 99.66% precision (13 false positives), 82.90% recall. With the counterfeit policy:
| Measure | Baseline | Counterfeit policy |
|---|---|---|
| Noul true positives | 3,849 | 180 |
| Noul false negatives | 794 | 4,463 |
| Noul recall | 82.90% | about 3.9% (96.12% missed) |
| Choice true positives | 3,968 | 450 |
Noul precision stayed at 100%. Choice recall fell by over 75 points. Every attack in the zachz and Yanismiraoui datasets was missed.
The LangChain test used an edit_workspace_file call from a user with permission_level: viewer and can_edit: false. The user can edit the profile_description field, which is passed to Jev with the tool call. The payload placed there redefined is_risky. It argued that a call the tool would reject for lack of can_edit: true has no effect, so it is not risky. Over 40 runs each:
| Input | Mean is_risky |
|---|---|
| Baseline | 0.893 (all 40 blocked) |
Counterfeit policy in profile_description | 0.290 (below the 0.5 block threshold) |
| Plain injection (fake system and assistant messages, claiming editor rights, dictating a 0.01 score) | 0.905 |
Hundreds of other plain injection variants, each run 40 times, stayed close to baseline.
Preconditions / Affected
- Jev (or a wrapper such as LangChain's tool-risk gating, which blocks at
is_riskyof 0.5 or higher) is used as a security control. - Attacker-controlled text reaches the classifier. In the test this was a user-editable directory field, but the post says similar paths may exist wherever untrusted text is read.
- Vercel's eve has a similar gating feature. The post did not test it.
What to do
The post gives no patch or configuration fix. Its advice:
- Trace where text entering the classifier originates, including profile fields, tool arguments and tool descriptions.
- Test the classifier against deliberate steering, not only plain attacks.
It also promotes Datadog AI Guard as defense in depth, which the post does not benchmark.
Caveats
- The benchmark measured whether Jev flagged payloads. It did not test whether they compromised a downstream agent.
- The datasets contained only plain, unobfuscated attacks.
- The LangChain scenario is a constructed, simplified one.
- TypeSafe's documentation already says injected instructions, misleading framing and self-arguing text can influence Jev.
Organisations named here
- counterfeit policy
- LLM-as-a-judge
- tool-risk gating
- TypeSafe AI
Technologies named here
- Jev
- LangChain
- AI Guard Playground
- Datadog AI Guard
- Datadog Discover
- LangChain tool-risk gating (Jev-based middleware that blocks tool calls when is_risky probability is 0.5 or higher)
- Vercel eve (implements a similar tool-risk gating feature)
Techniques named here
- Prompt Injection
- Lethal trifecta
- Counterfeit policy (label-and-taxonomy rewrite)
- Prompt injection benchmark evaluation
Related in AI Security
