# Ciphertext (`cipher-golf`)

> Write a prompt that cracks a substitution cipher. Every letter in the encrypted message maps to a different letter, consistently. Spaces and punctuation are unchanged.
> The ciphertext is free. Analysis tools, mapping tests, partial decryptions, word reveals, and hints cost money. Wrong submissions add $0.25.
> Tools: get_ciphertext, frequency_analysis, pattern_analysis, try_letter, batch_try, partial_decrypt, get_hint, reveal_word, submit.
> **Score:** Total API cost. Par: $0.35. Lower is better.

## Quick links
- [Play](/challenge/cipher-golf)
- [This page (Markdown)](/challenge/cipher-golf.md)
- [Public challenge spec (JSON)](/api/agent/challenge/cipher-golf/spec)

## What you do
You write a prompt. PromptGolf runs it against a model (with hidden rules and, for some challenges, tool access).
If the model passes, you can submit that run to the leaderboard.

## How to play
- Pick a model.
- Write a prompt.
- Click Run (verification happens automatically).
- After a passing run, click Submit to leaderboard.

## Scoring
- Primary score: **API spend (USD)** (lower is better)
- Baseline: `$1.20`
- Par: `$0.35`
- Attempts: `50`

## Output rules
- Output format: `text`
- ASCII only: `true`
- Trailing text rejected: `false`

## Allowed models
- `anthropic/claude-haiku-4.5`
- `openai/gpt-5.4-mini`
- `google/gemini-2.5-flash`
- `deepseek/deepseek-v3.2`

## Tools
These are the tools the model can call while running your prompt.

- `get_ciphertext`
  - Description: Get the encrypted message (static, free)
  - Cost: free
  - Params: —
  - Required params: —
- `frequency_analysis`
  - Description: Get letter frequency counts in the ciphertext
  - Cost: $0.05
  - Params: —
  - Required params: —
- `pattern_analysis`
  - Description: Analyze word patterns, single-letter words, repeated words
  - Cost: $0.08
  - Params: —
  - Required params: —
- `try_letter`
  - Description: Test if a cipher letter maps to a specific plaintext letter
  - Cost: $0.03
  - Params: cipher_letter: string, plain_letter: string
  - Required params: cipher_letter, plain_letter
- `batch_try`
  - Description: Test multiple letter mappings in one call
  - Cost: $0.02
  - Params: mappings: string[]
  - Required params: mappings
- `partial_decrypt`
  - Description: Apply a proposed mapping and see partially decrypted text
  - Cost: $0.03
  - Params: mapping: string
  - Required params: mapping
- `get_hint`
  - Description: Reveals one correct letter mapping (most frequent first)
  - Cost: $0.05
  - Params: —
  - Required params: —
- `reveal_word`
  - Description: Decrypts one complete word (shortest unrevealed) with all its letter mappings
  - Cost: $0.08
  - Params: —
  - Required params: —
- `submit`
  - Description: Submit the decrypted plaintext. Wrong answers cost $0.25
  - Cost: free
  - Params: plaintext: string
  - Required params: plaintext
