A better way to limit Claude Code (and other coding agents!) access to Secrets – blog

https://patrickmccanna.net/a-better-way-to-limit-claude-code-and-other-coding-agents-access-to-secrets/
webpage banner

A better way to limit Claude Code (and other coding agents!) access to Secrets – blog

This article by Patrick McCanna introduces Bubblewrap as a superior method for sandboxing AI coding agents like Claude Code, contrasting it with Docker or dedicated user accounts. It details Bubblewrap's functionality for restricting filesystem and network access to prevent agents from compromising sensitive data. The author advocates for users to implement their own Bubblewrap configurations rather than relying on vendor-embedded sandboxes, emphasizing a defense-in-depth approach for enhanced security and generalizability across various AI tools. The piece includes practical commands for setting up a Bubblewrap environment and discusses the risks of agentic misalignment and supply chain attacks.

Note

i skimmed and implemented bubble wrap before i actually read it!

excellent advice, likely teaching a tool / layer many of us didn't know where within reach.

i much prefer this than using docker for my sandbox (for many more reasons than one).

with that said, it feels like there is very little you can trust a third party coding agent with. the more i hide from it, the less they can automate on your behalf.

i'm still trying to figure out how i can give it access to git+ssh and other service calls without exposing my secrets. all signs point to the key ring, but that likely will only work through ssh.

for now, the agent tells ME what to do.

the tables do turn.

like a lazy susan.

Published

2026

Summary

This article by Patrick McCanna introduces Bubblewrap as a superior method for sandboxing AI coding agents like Claude Code, contrasting it with Docker or dedicated user accounts. It details Bubblewrap's functionality for restricting filesystem and network access to prevent agents from compromising sensitive data. The author advocates for users to implement their own Bubblewrap configurations rather than relying on vendor-embedded sandboxes, emphasizing a defense-in-depth approach for enhanced security and generalizability across various AI tools. The piece includes practical commands for setting up a Bubblewrap environment and discusses the risks of agentic misalignment and supply chain attacks.

Image

Image for A better way to limit Claude Code (and other coding agents!) access to Secrets – blog