frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: enveil – hide your .env secrets from prAIng eyes

https://github.com/GreatScott/enveil
41•parkaboy•3h ago

Comments

umairnadeem123•2h ago
this solves a real problem. i run coding agents that have access to my workspace and the .env files are always the scariest part. even with .gitignore, the agent can still read them and potentially include secrets in context that gets sent to an API.

the approach of encrypting at rest and only decrypting into environment variables at runtime means the agent never sees the raw secrets even if it reads every file in the project. much better than the current best practice of just hoping your .gitignore is correct and your AI tool respects it.

one suggestion: it would be useful to have a "dry run" mode that shows which env vars would be set without actually setting them. helps verify the config is correct before you realize three services are broken because a typo in the key name.

anshumankmr•2h ago
What about something like Hashicorp secrets? We have a the hashicorp secrets in launch.json and load the values when the process is initialized (yeah it is still not great)
hjkl_hacker•1h ago
This doesn’t really fix that it can echo the secrets and read the logs. `enveil run — printenv`
Datagenerator•1h ago
Not the author but No, the decryption would ask the secret again? The readme mentions it's wiped from memory after use.
Datagenerator•1h ago
Looks good. Almost stopped reading due the npm example, grasped it was just a use case, kept reading.

Kernel keyring support would be the next step?

PASS=$(keyctl print $(keyctl search @s user enveil_key))

hardsnow•1h ago
Alternative, and more robust approach is to give the agent surrogate credentials and replace them on the way out in a proxy. If proxy runs in an environment to which agent has no access to, the real secrets are not available to it directly; it can only make requests to scoped hosts with those.

I’ve built this in Airut and so far seems to handle all the common cases (GitHub, Anthropic / Google API keys, and even AWS, which requires slightly more work due to the request signing approach). Described in more detail here: https://github.com/airutorg/airut/blob/main/doc/network-sand...

NitpickLawyer•48m ago
How does this work with SSL? Do you need to provision certs on the agent VM?
hardsnow•43m ago
Yep - requires the client to trust the SSL cert of the proxy. Cooperative clients that support eg HTTP_PROXY may be easier to support, but for Airut I went for full transparent mitmproxy. All DNS A requests resolve to the proxy IP and proxy cert is injected to the container where Claude Code runs as trusted CA. As a bonus this closes DNS as potential exfiltration channel.
SteveVeilStream•1h ago
Sometimes I need to give Claude Code access to a secret to do something. (e.g. Use the OpenAI API to generate an image to use in the application.) Obviously I rotate those often. But what is interesting is what happens if I forget to provide it the secret. It will just grep the logs and try to find a working secret from other projects/past sessions (at least in --dangerously-skip-permissions mode.)
WalterGR•1h ago
What software do you use that logs credentials?
SteveVeilStream•47m ago
Claude Code does it. Check out the JSONL files.
l332mn•1h ago
I use bubblewrap to sandbox the agent to my projects folder, where the ai gets free read/write reign. Non-synthetic env cars are symlinked into my projects folder from outside that folder.
pedropaulovc•1h ago
1Password has this feature in beta. [1]

[1]: https://developer.1password.com/docs/environments/

jen729w•17m ago
You can already put op:// references in .env and read them with `op run`.

1P will conceal the value if asked to print to output.

I combine this with a 1P service account that only has access to a vault that contains my development secrets. Prod secrets are inaccessible. Reading dev secrets doesn't require my fingerprint; prod secrets does, so that'd be a red flag if it ever happened.

In the 1P web console I've removed 'read' access from my own account to the vault that contains my prod keys. So they're not even on this laptop. (I can still 'manage' which allows me to re-add 'read' access, as required. From the web console, not the local app.)

I'm sure it isn't technically 'perfect' but I feel it'd have to be a sophisticated, dedicated attack that managed to exfiltrate my prod keys.

Zizizizz•1h ago
https://github.com/getsops/sops

This software has done this for years

Zizizizz•1h ago
https://github.com/jdx/fnox

A recent project by the creator of mise is related too

NamlchakKhandro•1h ago
this won't solve the problem.

Instead you need to do what hardsnow is doing: https://news.ycombinator.com/item?id=47133573

Or what the https://github.com/earendil-works/gondolin is doing

nvader•45m ago
In the vein of related work, there is https://github.com/imbue-ai/latchkey which injects secrets into cURL commands issued by your agent.
stephenr•43m ago
> can read files in your project directory, which means a plaintext .env file is an accidental secret dump waiting to happen

It's almost like having a plaintext file full of production secrets on your workstation is a bad fucking idea.

So this is apparently the natural evolution of having spicy autocomplete become such a common crutch for some developers: existing bad decisions they were ignoring cause even bigger problems than they would normally, and thus they invent even more ridiculous solutions to said problems.

But this isn't all just snark and sarcasm. I have a serious question.

Why, WHY for the love of fucking milk and cookies are you storing production secrets in a text file on your workstation?

I don't really understand the obsession with a .ENV file like that (there are significantly better ways to inject environment variables) but that isn't the point here.

Why do you have live secrets for production systems on your workstation? You do understand the purpose of having staging environments right? If the secrets are to non-production systems and can still cause actual damage, then they aren't non-production after all are they?

Seriously. I could paste the entirety of our local dev environment variables into this comment and have zero concerns, because they're inherently to non-production systems:

- payment gateway sandboxes;

- SES sending profiles configured to only send mail to specific addresses;

- DB/Redis credentials which are IP restricted;

For production systems? Absolutely protect the secrets. We use GPG'd files that are ingested during environment setup, but use what works for you.

yanosh_kunsh•39m ago
I think it would be best if AI agents would honor either .gitignore or .aiexclude (https://developers.google.com/gemini-code-assist/docs/create...).
iamflimflam1•27m ago
The problem is, you cannot force the agent to do anything.

A suitably motivated AI will work around any instructions or controls you put in place.

jen729w•19m ago
It doesn’t even need to be motivated: just forgetful.
frgturpwd•39m ago
I prefer waiting till it gets me in trouble. So far, it having access to all my .env secrets seems to work out okay.
m-hodges•37m ago
This looks interesting. For agent-fecfile I used the system keyring + an out-of-process proxy (MCP Server) to try to maximize portability.¹

¹ https://github.com/hodgesmr/agent-fecfile?tab=readme-ov-file...

navigate8310•35m ago
I use the combination of sops and age combined with pre-commit hooks to encrypt.env files. Works tremendously well.
syabro•25m ago
I'm using https://www.litellm.ai/ as a proxy

Show HN: enveil – hide your .env secrets from prAIng eyes

https://github.com/GreatScott/enveil
41•parkaboy•3h ago•26 comments

Show HN: X86CSS – An x86 CPU emulator written in CSS

https://lyra.horse/x86css/
97•rebane2001•5h ago•28 comments

Show HN: Steerling-8B, a language model that can explain any token it generates

https://www.guidelabs.ai/post/steerling-8b-base-model-release/
126•adebayoj•7h ago•17 comments

Show HN: PgDog – Scale Postgres without changing the app

https://github.com/pgdogdev/pgdog
247•levkk•16h ago•51 comments

Show HN: Notion-CLI – Full Notion API from the terminal, 39 commands, one binary

https://github.com/4ier/notion-cli
2•4ier•59m ago•0 comments

Show HN: Babyshark – Wireshark made easy (terminal UI for PCAPs)

https://github.com/vignesh07/babyshark
105•eigen-vector•11h ago•39 comments

Show HN: Sowbot – Open-hardware agricultural robot (ROS2, RTK GPS)

https://sowbot.co.uk/
149•Sabrees•16h ago•41 comments

Show HN: AI Timeline – 171 LLMs from Transformer (2017) to GPT-5.3 (2026)

https://llm-timeline.com/
158•ai_bot•23h ago•55 comments

Show HN: AgentBudget – Real-time dollar budgets for AI agents

https://github.com/sahiljagtap08/agentbudget
5•sahiljagtapyc•2h ago•2 comments

Show HN: L88 – A Local RAG System on 8GB VRAM (Need Architecture Feedback)

3•adithyadrdo•3h ago•0 comments

Show HN: ClinTrialFinder –AI-powered clinical trial matching for cancer patients

https://www.clintrialfinder.info
2•chncwang•3h ago•0 comments

Show HN: CIA World Factbook Archive (1990–2025), searchable and exportable

https://cia-factbook-archive.fly.dev/
476•MilkMp•1d ago•98 comments

Show HN: Falcon – Chat-first communities built on Bluesky AT Protocol

5•JohannaWeb•5h ago•0 comments

Show HN: PaperBanana – Paste methodology text, get publication-ready diagrams

2•mylsz•5h ago•0 comments

Show HN: Enseal – Stop pasting secrets into Slack .env sharing from the terminal

https://github.com/FlerAlex/enseal
3•ops_mechanic•5h ago•0 comments

Show HN: BVisor – An Embedded Bash Sandbox, 2ms Boot, Written in Zig

https://github.com/butter-dot-dev/bVisor
17•edunteman•14h ago•5 comments

Show HN: Agent Multiplexer – manage Claude Code via tmux

https://github.com/mixpeek/amux
11•Beefin•16h ago•1 comments

Show HN: 3D Mahjong, Built in CSS

https://voxjong.com
130•rofko•1d ago•58 comments

Show HN: A geometric analysis of Chopin's Prelude No. 4 using 3D topology

https://github.com/jimishol/cholidean-harmony-structure/blob/main/docs/03-case-study-chopin-prelu...
48•jimishol•3d ago•11 comments

Show HN: A deadly simple tmux windows like start UI

https://github.com/liyu1981/tmux_start_ui
3•liyu1981au•7h ago•2 comments

Show HN: Implementing ping from the Ethernet layer (ARP,IPv4,ICMP in user space)

https://github.com/v420v/ping
8•ibuki256•22h ago•1 comments

Show HN: Local-First Linux MicroVMs for macOS

https://shuru.run
207•harshdoesdev•1d ago•63 comments

Show HN: Llama 3.1 70B on a single RTX 3090 via NVMe-to-GPU bypassing the CPU

https://github.com/xaskasdf/ntransformer
388•xaskasdf•2d ago•102 comments

Show HN: WorldCanvas – R/place, but with a real world map as the canvas

https://worldcanvas.art
3•recuerdame•10h ago•1 comments

Show HN: PureBee – A software-defined GPU running Llama 3.2 1B at 3.6 tok/SEC

https://github.com/PureBee/purebee
3•benryanx•10h ago•1 comments

Show HN: Peekl – A modern alternative to Ansible and Puppet

https://peekl.dev
2•redat00•10h ago•1 comments

Show HN: Rendering 18,000 videos in real-time with Python

https://madebymohammed.com/pysaic
41•mbmproductions•1d ago•5 comments

Show HN: Merkle Casino – Random CT Domains

https://merkle.altayakkus.dev
2•biosboiii•10h ago•0 comments

Show HN: Touch Trigonometry – interactive way to understand the trig functions

https://apps.apple.com/us/app/touch-trigonometry/id6758712159
2•matthewtoast•11h ago•0 comments

Show HN: Search-sessions – Search all your Claude Code session history in <300ms

https://github.com/sinzin91/search-sessions
4•sinzin91•11h ago•4 comments