DEV Community

suman raj
suman raj

Posted on Edited on

How I Scrub API Keys Locally and Cut AI Token Bloat Inside Browser Prompt Boxes

EngineNear

Every time I’m stuck debugging an Axios error dump or pasting .env snippets into ChatGPT, Claude, or Perplexity, I catch myself nearly leaking a Bearer token, sk- key, or internal secret in the stack trace.

Even when I manually strip out the secrets, my rushed prompt is usually bloated—wasting tokens and forcing 3–4 follow-up messages just to get a usable fix.

To solve both problems right inside the workflow, I built EngineNear, a lightweight, local-first Chrome extension that sits directly inside browser AI prompt boxes.

How It Works Under the Hood

  1. 100% Local Secret & PII Firewall: Combines known vendor prefixes (sk-, ghp_, AKIA, JWTs, Bearer headers) with Shannon entropy checks to mask sensitive credentials on your machine before anything ever touches the network.
  2. Inline Prompt Structuring: Compresses messy pasted error logs or half-baked thoughts into a structured, token-efficient prompt in one click.
  3. Zero Server Logging: All secret detection and scrubbing run locally in your browser—nothing is sent to an external backend.

Quick Before / After Example

Before (78 tokens + leaked Bearer token):

hey why is this failing axios 401 Authorization: Bearer eyJhbGciOiJIUzI1NiIs... here is my code fix it pls

After (34 tokens, scrubbed locally):

Debug an HTTP 401 Unauthorized response in an Axios request (Authorization: [REDACTED_BEARER_TOKEN]). Identify common header, token expiry, or CORS causes and provide a fix.

Try It & Share Feedback

You can test the free Chrome extension here: EngineNear (and if you're on Peerlist, we're also live on this week's Launchpad!).

I’d love feedback from fellow developers on:

  • What custom regex or internal secret formats we should support next
  • How you currently sanitize stack traces before pasting them into LLMs

Top comments (1)

Collapse
 
suman_raj_17 profile image
suman raj •

we're also live on this week's Launchpad!
PeerList EngineNear