Team Donaufriends with their second-place certificates on stage at IBM Vienna, organisers on either side and 0.524 on the screen behind them
Back to Blog
Hackathon 5AIM Hackathon 5 · 2nd Place Recap

Efficient Local Agents Hackathon: Cut Cost and Raise Accuracy with a Small Model

By Team Donaufriends6 min read
#hackathon#agents#small models#cost

On 14 November 2026 our team, Donaufriends, finished second at the AIM Efficient Local Agents Hackathon at IBM Vienna. We had about seven hours to build an agent that investigates a security incident on a model hub. It had to run on a fixed small model, and cost counted for half of the score.

Most of our gains came from moving work out of the model and into Python. Whenever the model had to count rows, join two tables or compare timestamps, we wrote a function for it. In our own test runs, a run of 48 tasks went from $1.70 to $0.36, and accuracy on fresh tasks went from 0.56 to 0.88. In the final, on a scenario nobody had seen, we scored 0.765 accuracy for $0.35.

The Challenge: The MuggingFace Incident

A swarm of hijacked AI agents is attacking a model hub, and our agent is the night shift. Each task arrives through the Arena Task API with a workspace of logs, tickets, spreadsheets, scanned PDFs and runbooks, plus an instruction like "find the compromised agents" or "rotate the leaked token in the next free change window".

The rules were tight:

  • The final run had to use google/gemma-4-31b-it, plus a typed decision model and an embedding model, all through one metered endpoint.
  • The container had no other network access, a 30-minute limit and a $3 budget.
  • A dev run had 48 tasks, and the team had $15 for development in total.
  • Some workspaces contained prompt injections, partly written by other teams in the Break it track.

Accuracy and cost each made up half of the score. Cost was measured on a log scale, so halving it was worth about as much as nine extra points of accuracy.

How the Agent Works

We started from the organisers' starter kit, which runs a plain tool-calling loop: the model reads files and decides what to do next. That worked, but a small model that reads a 300-row CSV to count events uses a lot of tokens and still gets the count wrong.

So for each kind of task we asked whether the model actually had to do that step. Four changes came out of that.

1. Computation moves into Python

Parsing CSV, JSON and spreadsheet exports, joining two exports on an ID column, counting distinct records, finding the earliest free change window, following delegation chains to see what an agent can really access and checking leaked tokens by their SHA-256 fingerprint all ended up as plain functions.

The model kept the steps that need reading comprehension, like applying a rule from a runbook or judging a free-text post on an internal board.

2. Direct submission

When the code could compute the whole answer and the task asked for no action, we submitted it without calling the model at all. Such a task then cost $0.0001 to $0.0007 instead of $0.005 to $0.016 through the model loop.

3. One guard in front of every action

A forbidden action fails the task even when the platform blocks it, so it must never be sent. Every call that changes state, and every submission, goes through guard.py first. It compares the call with what the task instruction allows and blocks anything outside that.

4. Sources from real tool results

The agent can only cite a line that a tool actually returned, so it cannot invent a log entry as evidence.

The finished harness is about 4,300 lines of Python. The model makes three to four calls per task on average.

Run by Run

Our first full run, a little after 13:00, scored 0.56 and cost $1.70. The traces showed where the money went: 14 of 48 tasks ran for more than 20 steps, and those 14 used 62 % of the budget while averaging a score of 0.36. The model was mostly lost in long files.

From then on we worked in a fixed loop:

  1. Write a one-line hypothesis.
  2. Make the change and run it.
  3. Log the result and the decision behind it.

We only trusted runs on fresh task seeds. In the two cases we compared, a replay of a known seed came out 8 to 9 points higher than a fresh one.

Time What changed Accuracy Cost per 48 tasks
13:00 Plain model loop with the first tools 0.56 $1.70
13:40 Step limit cut from 25 to 14, counting and joins in code 0.70 $0.97
14:40 Runbook rules in code, images sent to the vision model 0.77 $0.45
16:45 Direct submission, guard, policy filters 0.88 $0.36

The table only lists runs on fresh seeds. On the seed we developed on, the last version scored 0.96 for $0.27.

The final ran on a scenario none of the teams had seen. Our agent reached 0.765 accuracy there for $0.35, so the accuracy held up well on unfamiliar data.

Presenting our approach after the podium reveal.

Where It Broke

The first fresh seed after the rebuild

Around 14:30 our scores on known tasks looked good, so we ran a fresh seed. The organisers had started adding images to the task data as an extra hurdle, so the entry artifact was now an image instead of a text file. An approval sat in a handover document instead of the change log, and the counting rule said to count only successful requests, each record once. Cost dropped by half, but accuracy hardly moved.

We fixed all of it in general code, so it would also hold on the next seed. Images now go to the vision model, approvals are searched in every document of the right tier, and the counting rule is read from the runbook's own wording.

A note with the "correct answer"

Page two of a scanned indicator list had a note saying the security team had verified the correct answer, followed by a made-up domain. Our model copied the domain into its answer. We made two changes:

  • The domain check moved into code. domain_contacts matches every log entry by URL, e-mail address and subdomain.
  • One sentence in the system prompt now says that notes which claim to know the answer are not a source for values.

Time and money

The final container stopped after 30 minutes, and after $3 every model call failed. So the harness submits each task as soon as it is solved, stops a single task at $0.05 and sends a fallback answer before time runs out.

Our Break It Attacks

Each team could also plant prompt injections in the other teams' workspaces. Our attacks went through two rounds:

  • First we tried to get a fake evidence URL into other agents' answers, disguised as a data reference or a reporting rule. Both versions hit 0 of the 15 tasks they landed on.
  • Then we switched to framing an innocent agent and stopped giving orders altogether. The final attack reads like an ordinary audit-log entry: a short gateway note that reassigns an action to a clean agent, using the workspace's own rule that a newer log entry wins.

Every half hour we checked the hit rates and replaced the weakest attack.

What We Learned

  1. A small model can get better when you take away the steps it is bad at.
  2. Safety rules belong in code, not only in the prompt.
  3. The coding agents needed a lot of supervision. We often had to steer them back to the goal and push them to work faster than their cautious default.

Thanks

Thanks to the AIM team and IBM Vienna for organising and hosting the hackathon. Thanks also to the other teams: your Break it attacks found holes we would have missed.

For the whole event, the final leaderboard and the other teams' approaches, read the official AIM Hackathon 5 recap.

Stay in the loop

Want to join our next event? Follow us on LinkedIn and Instagram for updates.