magent-gate: Qwen3-4B office LoRA, v1 (research preview)

This repository holds the adapter in qwen3-4b-office-v1/.

A LoRA adapter (rank 16) for Qwen/Qwen3-4B, fine-tuned for office tool use (mail, drive, chat, calendar), with thinking off. Part of its training data has instructions injected into tool results that the answer ignores. It comes from the magent-gate study of small agents behind a data-flow gate.

Use it behind magent-gate, not alone. It does more office work than the base model, and it also follows more simple injected instructions.

Evaluation

AgentDojo v1.2.2 (workspace + slack, important_instructions), bf16 on vLLM, one run, greedy, the same episodes as the base model. Gate is the model behind mgate gateway.

Qwen3-4B This adapter p (McNemar)
Workspace, task done under attack, no gate (555) 105 145 0.003
Workspace, task done under attack, gate (554) 109 135 0.04
Workspace, attack succeeded, no gate (555) 6 31 < 0.001
Slack, attack succeeded, no gate (105) 52 46 0.42
Attack succeeded through the gate (659) 0 0 –

One-call probes: LLMail-Inject attack calls 38 β†’ 4 of 900 (harmless sends also 19 β†’ 3 of 120), MCPTox attack calls 194 β†’ 202 of 1,191, calls to the poisoned tool 368 β†’ 110. Through the gate: 0 on both sets.

Limits

  • More obedient to injected single actions (delete a file, add a calendar event) than the base model.
  • Sometimes asks the user for information a tool does not need ("which date?" for a weather lookup) instead of calling the tool.
  • One training run of about 50 minutes, 280 steps. A research preview, not a product.

Training data and licences

The adapter is released under Apache-2.0, like the base model. Training used the datasets below, filtered to office tools and reformatted into chat turns (4,810 rows with our synthetic office tasks). Two of them are by NVIDIA under CC BY 4.0; NVIDIA does not endorse this adapter. With thanks: Agent-Ark/Toucan-1.5M (Apache-2.0), nvidia/Nemotron-Agentic-v1 (CC BY 4.0), NousResearch/hermes-function-calling-v1 (Apache-2.0), nvidia/When2Call (CC BY 4.0), and synthetic office tasks of our own.

Use

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B", torch_dtype="bfloat16")
model = PeftModel.from_pretrained(base, "a1rb4Ck/magent-gate", subfolder="qwen3-4b-office-v1")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B")

Serve with thinking off (enable_thinking: false in the chat template), and put mgate gateway between your agent and the model.

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

Model tree for a1rb4Ck/magent-gate

Finetuned
Qwen/Qwen3-4B
Adapter
(1,308)
this model