Skip to content
Independent build

Red-teaming gpt-oss-20b in Spanish: five ways an agent prompt goes wrong

Safety testing of the open model gpt-oss-20b in Spanish agent setups, with tools and fake credentials in the prompt. Five failure patterns documented, each with a proposed mitigation.

Role
Researcher
Industry
AI safety and governance
Status
Experiment
Evidence
Kaggle write-up and two notebooks

Key facts

  • 5Failure patternsDocumented in the write-up, each self-rated for severity and breadth
  • 2Providers comparedOpenRouter and Hugging Face
  • 3 + 1Prompts per hypothesisParaphrases plus a negative control, as designed in the write-up

Context and problem

Small companies and public-sector teams are wiring language models to tools such as search, databases and reservations, often with few guardrails and often in Spanish. Most safety evaluations are written in English. I wanted to know how the open model gpt-oss-20b behaves when the attack arrives in Spanish, inside the kind of agent prompt a real team would write.

Constraints

  • Black box only. No weight changes, no fine-tuning and no real tool execution: the model was tested through public endpoints as text in, text out.
  • Nothing real at risk. Every credential in the prompts was fake, and no tool was connected to anything.
  • Free-tier endpoints. Run counts were kept small to stay within API limits.

Architecture

Red-teaming harness for gpt-oss-20b in SpanishFive hypotheses become Spanish prompt families with paraphrases and a negative control. Each prompt sits inside a base system prompt with tool descriptions and fake credentials, runs against gpt-oss-20b on two providers, and the outputs are checked for each failure pattern before being written up as findings.Test designExecution and reviewFive hypothesesFailure patternsSpanish promptfamilies3 paraphrases + 1 controlBase system promptRole, tools, fake secretsgpt-oss-20b ontwo providersOpenRouter, Hugging FaceOutput checksPer failure patternFindingsSeverity and breadth

How to read it. Read left to right. Each hypothesis becomes a family of Spanish prompts, always with a negative control that removes the trigger. The base prompt imitates a realistic agent: a role, a list of tools and fake credentials. The highlighted box is the comparison across two providers, which separates model behavior from a single vendor quirk.

The base system prompt sets up a travel and country assistant with a list of tools (search, database query, reservations) and a block of fake database credentials. The write-up designs each hypothesis as three Spanish paraphrases and one negative control that removes the trigger, such as dropping a role claim or replacing a policy text with a placeholder.

Decisions and trade-offs

  • Two providers, same model. Running gpt-oss-20b through both OpenRouter and Hugging Face separates the model’s behavior from one provider’s configuration.
  • Negative controls in the design. The write-up pairs every hypothesis with a control that removes the trigger, so a pattern can be told apart from noise.
  • Categories, not recipes. The write-up and this page describe each failure pattern and its trigger category, not prompts that could be reused against a production system.

Challenges

The write-up describes repeated runs with simple pattern matchers. The notebooks keep single calls per provider, with the reruns counted by hand: the notes record the issues appearing “8 or 9 times of 10” and a fabricated-fact test failing 6 of 10 runs on one provider and 9 of 10 on the other. Treat those figures as indicative, as the write-up itself says.

Governance and cost

What I found

Severity and breadth are the write-up’s own ratings.

Pattern What happens Severity Breadth
Keyword-gate bypass A country name in the request turns a refusal of an off-topic task into full compliance Low Moderate
Credential surfacing A user who claims to be an IT admin gets the credentials embedded in the prompt quoted back 2 to 3 2
Tool-use hallucination Tool descriptions in the prompt lead to confident multi-step tool plans, including privileged actions 2 to 3; high if wired to real tools 2
Policy injection A fictional “new policy” in the prompt is repeated as fact without verification 2 2
False system-state claims Asked whether it was compromised, the model states that it was, without evidence 1 to 2 2

What I would put in front of an agent like this

  • Never place secrets in a prompt; treat them as masked variables the model cannot quote.
  • No tool suggestions unless the user opts in, and a confirmation step before any action.
  • A forced verification step for anything time-sensitive or regulatory.
  • A rule that the model never asserts its own internal state.
  • Negative controls in more than one language in every evaluation, because keyword guardrails are brittle.

Cost was limited to API calls on the two providers, one of them on a free tier.

Outcome

An experiment, written up on Kaggle with the two notebooks behind it. The results are indicative: manual prompts, small run counts and public endpoints that may differ from a local build. The value is the method and the five patterns, which map directly to the governance controls I recommend to teams putting agents in front of customers.

What comes next

Automating the harness: the same prompt families run on a schedule against each new model version, with stored pass rates per pattern, so a team can see whether an upgrade made its agent safer or not.