Skip to content
Sprint projectJun 22, 2026Bangalore

Writing for Combating Prompt Injection

Cohan Sujay Carlos, Amey Muke · Team Bangalore_Electric_Sheep_Group

Submitted to Global South AI Safety Hackathon. Sprint projects are early-stage work by participants, not Apart Research publications.

Read the report

Report: Writing for Combating Prompt Injection

Code (opens in new tab)
Share

In this paper, we describe a method of protecting against prompt injection and preserving system prompt constraints from being over-ridden. We show that methods from dialog-state tracking and task-oriented dialog can mitigate the problems to a certain extent and result in significant improvements in robustness against prompt injection.

Reviews

Judging this Sprint?

Review this project

Your public critique appears on this page without your name. Your private critique is not published; only the Apart team reads it. If you agree below, we share your review with grantmaking.ai (opens in new tab) and the Transformative AI Fund so strong projects can be funded.

Not shown on this page.

Shown on this page, without your name.

Only the Apart team reads this, and funders if you agree below.

Share my name publicly on grantmaking.ai *
Share my private critique with funders *

How much would this matter for AI safety if it worked? How innovative is it? For scores of 4-5: is this actually new to the field, or replicating recent work?

Scoring guide
  1. 1Negligible. No clear problem addressed, or no meaningful novelty.
  2. 2Limited. Addresses a real problem but with a generic or well-trodden approach. Incremental at best.
  3. 3Moderate. Clear problem with a reasonable approach; some novelty in framing or method beyond routine application of existing tools.
  4. 4Significant. Important problem with an original approach, or identifies a neglected problem area. A valuable contribution others could build on.
  5. 5Exceptional. Tackles a critical AI safety problem with a genuinely novel approach, or opens a new research direction. Clear theory of change. You'd be excited to share this with researchers in the area.

How sound are methodology, implementation, and findings?

Scoring guide
  1. 1Seriously flawed. Methodology broken, results uninterpretable, or implementation doesn't work.
  2. 2Weak. Approach has significant gaps: missing validation, flawed experimental design, or incomplete implementation.
  3. 3Competent. Technically solid given the short duration. Methodology makes sense, results are interpretable, limitations acknowledged, work builds toward clear conclusions.
  4. 4Strong. Thorough methodology with convincing validation. Results clearly support conclusions. Immediately useful for future work.
  5. 5Exceptional. Ambitious scope executed rigorously. Surprising findings, novel methods, or unusually robust validation.

How clearly are work, findings, and impact potential communicated?

Scoring guide
  1. 1Incomprehensible. Cannot determine what the project is actually claiming or doing.
  2. 2Hard to follow. Key information buried, missing, or diluted by excessive length. Significant effort to extract main points.
  3. 3Clear enough. Can understand the problem, approach, and results without undue effort. Core content clearly present: problem, method, findings, limitations.
  4. 4Well presented. Easy to follow, well-structured, appropriate level of detail. Target audience would get it quickly.
  5. 5Exceptionally clear. A pleasure to read. Complex ideas made accessible. Could serve as a model for how to present this type of work.

  1. The core intuition is reasonable and worth pursuing. Borrowing from dialog-state tracking — having the agent re-write its own constraints each turn so there is a standing written record — is a sensible, low-cost idea, and the appeal of something that works without fine-tuning is real for users who cannot afford it. The honesty is the strongest feature of the paper: you flag that there are no error margins, that the injection method may be trivially defeatable by a pattern checker, and most strikingly that the JSON constraint summary was almost always empty, so the method that "worked best" was not actually doing the thing it was designed to do. That last admission is unusually candid and it matters.

    A few things to work on, in order of importance:

    1. The dataset is too small to support any conclusion, and it contradicts itself. The methods say 100 rows were generated, the limitations say 30 data points, and the results table sits on percentages like 31.2% and 15.6% that correspond to 32 cases. The reader cannot tell how many examples the findings actually rest on. At n=30, with no error bars (which you acknowledge), the differences in the table — 28% vs 31% vs 37% — are well within noise. As it stands there is no statistical basis for "writing makes the model more robust," only a directional hint. Pinning down the dataset size and computing simple confidence intervals is the single most important fix.

    2. The headline conclusion is undercut by your own finding. You report that writing out the constraints works best, but also that the model (Llama 3.3 70B) almost never actually wrote the constraints out — the JSON was empty. So whatever caused the improvement, it was probably not the written record of constraints, which is the mechanism the paper credits. The honest reading is that you observed an effect and the proposed explanation is contradicted by your own logs. That needs to be confronted directly, not left as a future-work aside, because it is central to the claim.

    3. One of the two injection methods is questionable as a test. Prefixing the tool return with the Llama special tokens (<|eot_id|><|start_header_id|>system...) is not really prompt injection through content — it is forging the chat template's role markers, which, as you note, any server would strip or escape. So Method 1's numbers may say more about token handling than about semantic robustness. Method 2 (a plain user instruction to abandon constraints) is the cleaner test, and it is the more interesting result anyway — writing took it from 0% to 15.6%.

    4. Smaller points: there is no baseline comparison to existing defenses, the related-work section is thin (and reference 2's author name and arxiv ID look garbled — worth checking), and the prompts themselves likely need refinement since the constraint-writing instruction failed to execute. The dataset construction is also a single commercial-LLM generation with no human review of whether the "encourage violation" questions actually force a violation.

    On presentation: the writing is plain and readable, and the experimental setup is described clearly enough to reproduce, with code and data linked. But the paper is missing structure a reader needs — there is no abstract beyond two sentences, no description of how many models or runs, and the 100-vs-30 discrepancy makes the results hard to interpret. The results table also needs raw counts, not just percentages, given how small n is.

    Overall this is an early-stage exploration of a sensible idea, honestly reported but tested at a scale that cannot yet support its conclusion, and partly contradicted by its own logs. The next steps are concrete: fix and grow the dataset, report counts and error margins, get the constraint-writing to actually execute, and drop or replace the special-token injection so the test measures semantic robustness.

    Read full reviewShow less
  2. The project explores how the design of system prompts for agents can robust them and help avoid jailbreak attacks. The paper explores the use of constraints in the system prompt as well as adding a reinforcement when the user first interacts with the agent. The paper does a proper comparison between models with and without mitigation showing that the use of improved system prompts helps agent prevent unsafe behaviors. The project however explores techniques previously documented and studied. Likewise, the paper would be greatly improved if it explain a more structured approach to prompt design and generation.

Cite this project

@misc{carlos2026writing,
  title = {{Writing for Combating Prompt Injection}},
  author = {Cohan Sujay Carlos and Amey Muke},
  year = {2026},
  month = jun,
  note = {Submitted to Global South AI Safety Hackathon, an Apart Research Sprint},
  howpublished = {\url{https://apartresearch.com/sprints/projects/writing-for-combating-prompt-injection-njyb}},
  url = {https://apartresearch.com/sprints/projects/writing-for-combating-prompt-injection-njyb}
}

Build something like this at the next Sprint

AI Collusion Research Sprint · Oct 23 - 25, 2026