Submission

JetBrains submission: repo https://github.com/pukoa420/PRIVATE_KEY_4
commit 9e7f09c345b29b8998ce2d527f81bd45dc75eef3
submission/Dockerfile

Inspiration

We were inspired by the eMudhra Certificate Authority. A CA's whole job is to keep private keys private while still letting trust flow outward. We wanted the same guarantee for developers who send their code to cloud LLMs and coding agents.

What it does

PRIVATE_KEY_4 is a privacy gateway that sits between a developer (or their coding agent) and a cloud LLM. Before anything leaves the machine, it finds API keys, passwords, tokens, private keys, internal hosts and IPs, and personal data. It replaces each one inline with a placeholder that stays consistent across the repo. When the response comes back, it puts the real values back byte for byte.

# what the developer has
DB_PASSWORD = "Wq7rT2mZp9Lk"

# what the cloud LLM sees
DB_PASSWORD = "<SECRET_7>"

The code still parses, the LLM still understands it, and no secret leaves the building. It ships as a Docker image with sanitize and restore commands. It also runs as an ACP agent inside JetBrains Air, with selectable privacy levels and masked diffs.

How we built it

files ──► rule engine: propose candidates ──► Mellum2: secret or not? ──► placeholders
          (cheap, high recall)                 (context, precision)
  • Hand-written rule engine: about 30 detector components. They cover vendor token formats, keyword and assignment analysis, config-file parsers (JSON, YAML, TOML, .env), base64 and URL decoders, entropy and password-shape scoring, username/password pair detection, infra and PII detectors, and filters for placeholders, UUIDs, documented example keys and symbolic constants.
  • Mellum2 as the final judge: candidates the rules are sure about are masked right away, and obvious public values are kept. Only the uncertain middle goes to JetBrains Mellum2, one line of context per value, ranked by expected score gain and batched 15 per request.
  • Fail-closed design: no answer, a timeout, or a 429 from Mellum2 means the value is masked. A global time budget keeps every repo under the 300 s limit.
  • Evaluation discipline: we split dev into open, blind and lockbox sets so we tuned on classes of misses, never on specific values.

Challenges we ran into

  • Recall vs. precision: the score is

$$ \text{Score} = 100 \times F_1(\text{recall}, \text{decoy precision}) \times \text{integrity} $$

so masking everything that looks random costs as many points as it gains, because decoys are designed to look like secrets.

  • Mellum2's budget: thinking costs about 250 tokens per candidate, under tight rate limits. We had to choose which roughly 60 questions per repo were worth asking, and skip any question whose answer couldn't change the result.
  • Exact round trips: byte-exact restores and files that still parse ruled out masking identifiers, quotes or whole lines.
  • Local traps: CRLF line endings from git, Windows Defender quarantining sanitized test files, and detector combinations that pushed some repos to around 950 s.

Accomplishments that we're proud of

  • The score went from 30.6 for the starter baseline to about 92 using rules alone. On the blind split, Mellum2 as final judge raised it from 91.85 to 92.74, with integrity at 1.0.
  • Everything is hand-built and stays within the rules, and the slowest repo finishes well inside the time limit.
  • We turned it into an actual developer tool, an ACP agent in JetBrains Air, not just a benchmark entry.

What we learned

  • Cheap heuristics with high recall, plus a small LLM making the final call on the hard cases, beats either one alone.
  • Context matters more than shape: the same random string is a secret after DB_PASSWORD= and a decoy in a test vector.
  • Held-out evaluation is essential when the hidden test set uses different disguises from the one you can see.

What's next for PRIVATE_KEY_4

  • HMAC-based placeholders that stay stable across sessions and machines.
  • Smarter routing that sends more borderline cases to Mellum2 when there's budget to spare.
  • More file formats and languages, plus IDE plugins beyond Air.
  • Per-organization allow and deny lists for internal hostnames and naming conventions.

Built With

Share this project:

Updates

Submission history