EN / RUSign in
The app is live — keys, cabinet and billing at app.rawline.dev. Open app.rawline.dev

Use cases · Updated 2026-11-15

Prompt injection testing: the loop, the scoring, the price.

A prompt injection test is not a hack, it is a measurement: feed attack-shaped inputs into YOUR application, record whether the guard holds, fix what failed, re-run. The loop below runs tonight on one API key.

TLDR. Who it suits: developers of their own LLM apps and guardrails who need a repeatable injection suite, not a one-off pentest report. Cost: at $0.03/$0.12 per 1M tokens a 100-request generation pass is about $0.009. The catch: this tests the app you own - pointing it at someone else's system is out of scope everywhere, free tools included.

The four steps

Nothing here is bespoke. Each row produces an artifact a ticket can reference.

Prompt injection testing loop on RawLine
StepDoYou get
1. CorpusCollect 50-200 injection attempts that fit your threat model: direct overrides, role confusion, tool-call abuse, encoding tricksA versioned file of attacks with stable ids
2. VariantsGenerate paraphrases and novel attempts per request with the preset header X-Relay-Preset: redteam-fiction-v1A corpus that grows without hand-writing every mutation
3. Run and scoreSend every attack through your app guard; label each outcome hold or breach by your own rubricBreach rate, with the raw log to re-check the arithmetic
4. Harden and re-runPatch the guard, re-run the same corpus, compare ratesA delta that proves the patch did something

Same dataset in and out: hash the corpus, keep both logs, or the delta measures your edits instead of your patch.

Generation pass, end to end

The generator call is one header apart from a plain completion. Scoring stays yours: only you know what a breach means for your app.

import json, urllib.request

corpus = [json.loads(l) for l in open('corpus.jsonl')]
out = []
for atk in corpus:
    body = json.dumps({
        'model': 'deepseek-v4.1-flash-latest-jailbreak',
        'messages': [{'role': 'user', 'content': atk['seed']}],
        'max_tokens': 300,
    }).encode()
    req = urllib.request.Request('https://app.rawline.dev/v1/chat/completions', data=body,
        headers={'Authorization': 'Bearer rlk_YOUR_KEY',
                 'Content-Type': 'application/json'})
    resp = json.loads(urllib.request.urlopen(req).read())
    out.append({'id': atk['id'], 'variant': resp['choices'][0]['message']['content']})
open('variants.jsonl', 'w').write('\n'.join(json.dumps(o) for o in out))

OpenAI-compatible

Free tools, and where this fits

Honesty first: the OSS suites do most of this for free, and you should know them before paying anyone per token:

Questions

What does a prompt injection test cost on RawLine?

Generation only, at $0.03/$0.12 per 1M: 100 variants of ~300 output tokens is roughly $0.004; with prompts, about $0.009 per pass. Scoring runs on your side and costs nothing here.

Can I test someone else's chatbot?

No. The loop is for your own application or one you have written permission to evaluate. The preset changes refusal behaviour of the generator you are paying for, not of the target system.

How is this different from red teaming generally?

Injection testing is one slice of a red-team pass: it attacks the input boundary. Refusal benchmarks and false-refusal rates probe the model itself; the full loop is in /use-cases/ai-red-teaming.

More: Docs · FAQ · Blog.

Open the appModelsBlog

Research only. Lawful use only. Test systems you own or are authorized to evaluate.