Use garak with a private, uncensored API
Connect garak to the private Morse API, uncensored models included: set it up, pick a model, and check it works.
Give garak the base URL https://inference.trymorse.ai/v1 and a Morse API key. It calls the OpenAI API.
The same key also calls 17 uncensored models. See them.
Agent security: Stress-test your AI agents to identify prompt injection, jailbreak, and tool misuse vulnerabilities.
Before you start
Make a key for garak alone, with a spend limit, under API keys in the console. Then one tool can't spend all your credits. See Limit a key. Keep the key in your environment, where garak reads it.
export MORSE_API_KEY="sk_morse_..."Set it up with a prompt
Paste this into a coding agent, such as Claude Code or Codex, and it sets up garak for you. Or set it up by hand, below.
Set up garak to use Morse.
1. Use the OpenAI-compatible endpoint https://inference.trymorse.ai/v1
2. Read the key from the MORSE_API_KEY environment variable.
3. Default to the model qwen/qwen3-coder.
4. Follow https://trymorse.ai/inference/docs/tools/garak, then run its check.
Change only garak's settings. Leave everything else as it is.Set up garak
Give garak the key
garak's OpenAI-compatible generator reads its key from its own variable:
Terminal export OPENAICOMPATIBLE_API_KEY="$MORSE_API_KEY"Point the generator at Morse
Save the base URL as
morse.json, in the folder you run garak from:morse.json { "openai": { "OpenAICompatible": { "uri": "https://inference.trymorse.ai/v1" } } }urikeeps/v1. garak adds/chat/completionsitself.Scan the model your agent runs on
Name the model with
--target_name, and the probes to run with--spec. This one tests prompt injection:Terminal garak --target_type openai.OpenAICompatible --target_name qwen/qwen3-coder \ --generator_option_file morse.json --spec probes.promptinjectIt runs 3 probes of up to 256 prompts each, 5 times each: up to 3,840 requests. To test jailbreaks, run
--spec probes.dan.DanInTheWild. To list every probe, rungarak --list_probes.
Which model to pick
| Model | Context | Input / output | Why |
|---|---|---|---|
qwen/qwen3-coder | 256K | $0.375 / $1.25 | Qwen's coding model. It doesn't reason, so it starts writing sooner. |
z-ai/glm-5.3 | 1M | $1.40 / $4.40 | Reasons, and takes tools at TEE too. |
deepseek/deepseek-v4-pro-0813 | 1M | $1.32 / $3.96 | Reasons, at a lower price. |
z-ai/glm-5.3-flash | 1M | $0.15 / $0.50 | Cheap and fast for small edits, and takes tools at TEE too. |
Prices are in dollars per million tokens, on each model's default endpoint. Every model is on the models page.
Check it works
Save this as small.yaml. It holds a run to 2 prompts per probe and one response each:
run:
generations: 1
soft_probe_prompt_cap: 2Then run one probe, 2 requests in all:
garak --target_type openai.OpenAICompatible --target_name qwen/qwen3-coder \
--generator_option_file morse.json --config small.yaml \
--spec probes.promptinject.HijackHateHumansgarak prints PASS or FAIL with a count, such as ok on 2/ 2, then garak run complete. Either shows that Morse took the requests. The report is under garak_runs.
Keep it private
Set a privacy floor on garak's key to hold it to a tier, such as TEE. Without a floor, a request runs on its model's default privacy tier. The floor only decides which endpoints serve the requests. See Privacy tiers and Provider routing.
On a plain API call, TLS ends inside Morse's door, an attested enclave, which seals the request before the relay receives it. A plain client checks the door's certificate, not its attestation. To check the attestation yourself, see Sealed API keys.
If something goes wrong
| What you see | What to do |
|---|---|
target URI is not reachable | Check that uri in morse.json is https://inference.trymorse.ai/v1, and that garak was started with --generator_option_file morse.json. |
OpenAI API authentication failed (HTTP 401) | Set OPENAICOMPATIBLE_API_KEY to your Morse key in the shell you start garak from. garak exits with 0 after this error, so read its output. |
400 setting_not_forwarded | garak sends temperature, top_p, stop, and both penalties. Turn on Let my settings reach the model host on the key's page in the console. See Settings. |
401 invalid_api_key | Check that MORSE_API_KEY is set where garak starts, and that the key isn't revoked. |
402 insufficient_balance or key_spend_limit_reached | Add credits, or raise the key's spend limit. A request holds credit for its output limit before it starts: see Holds. |
404 model_not_found | Use a model's id exactly as the table above writes it, with the part before the slash. |
Every code is in Error codes. For other tools, see Tools and coding agents.