Menu

Let the Secret Decide Where the Prompt Runs
📰

Let the Secret Decide Where the Prompt Runs

DEV Community: python·Riley Wu·about 16 hours ago
#XwAebwLr
#devtopython#devto#dev#gate#local
Reading 0:00
15s threshold

Let the Secret Decide Where the Prompt Runs

A pasted config file should never reach a remote model. Not because remote is slow. Because the payload carries keys.

Latency arguments come later. Secret class comes first, and it is a policy call. Decide on what the text contains, then on how fast it must return.

The rule nobody enforces

You paste forty lines of .env into a chat box. The answer is good. The request is also gone.

Most teams handle this with a guideline. Do not paste secrets. Guidelines without a gate decay in about a week.

So build the gate. Three checks, one decision, fail closed. The gate runs before the client library, not inside your head.

The gate is three checks

Check one is pattern matching for known credential shapes. Check two is Shannon entropy over long tokens. Check three is the budget: offline, or local p50 above your limit.

#!/usr/bin/env python3 # egress_gate.py - decide local vs remote before a prompt leaves the machine.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.