# How to limit what Claude Code can access

Control Claude Code with per-tool allow-lists, an approval inbox for risky moves, and hard spending budgets.

Published 7 September 2026 · By The GainWix team · Gateway · https://gainwix.ai/blog/how-to-limit-what-claude-code-can-access/

You limit what Claude Code can access by routing all its tool calls through the GainWix AI Studio gateway. This local-first control plane lets you set per-tool allow-lists, enforce an approval inbox for risky moves, and define hard spending budgets to prevent runaway costs. It's a simple shift. You stop trusting the model. You start trusting the rails.

## What are the three levers of control?

You don't leave the keys in the lock. You use three specific tools to keep the agent honest.

| Lever | What it does | When to use it |
|---|---|---|
| Allow-lists | Blocks specific tools or folders | Stop AI from touching your .env or SSH keys |
| Approval Inbox | Holds risky moves for a click | Prevent accidental `rm -rf` on production |
| Budgets | Sets hard limits on API spend | Stop an autonomous loop from costing $500 |

The allow-list is your first line of defense. You define exactly which folders the agent can see. For example, you can grant access to your `/src` folder but block your `/config` directory. The agent can't hallucinate its way past these rules. The gateway blocks the call before it ever hits your disk. It is total control.

The Approval Inbox handles the grey areas. Some tool calls are too risky to automate. When Claude Code tries to execute a destructive command, the gateway pauses the run. It sends a notification to your inbox. You check the intent and click approve or reject. It's a human-in-the-loop safety switch. You stay in charge.

Budgets stop the money bleed. Autonomous agents can get stuck in a loop. They might try ten different ways to fix a bug, burning through tokens in seconds. GainWix AI Studio sets a hard stop. Once the limit hits, the agent stops. No surprises on the invoice.

## Steps to limit access today

You can set this up in a few minutes.

1. Download GainWix AI Studio from gainwix.ai.
2. Connect your Claude Code instance to the gateway. This creates the one doorway for all tool calls.
3. Open the security tab to define your allow-lists. Mark your sensitive directories as blocked.
4. Set a daily budget in the cost shield. This prevents runaway costs.
5. Enable the approval inbox for any tool that can modify the filesystem.

Now every tool call goes through one gateway you control. You can see this in action at our [/security/](/security/) page.

## What the gateway doesn't do

This isn't a firewall for your network. It doesn't stop Claude from reading a file if you've already given it access to that folder via the OS. It only controls the tool calls the agent tries to make. It's a control plane, not a sandbox.

If you want to understand how this fits into a larger architecture, read about our [/blog/one-doorway/](/blog/one-doorway/) approach. You can also see how this compares to the [/blog/what-is-an-mcp-gateway/](/blog/what-is-an-mcp-gateway/) model.

GainWix AI Studio is a local-first control plane. Your secrets and logs stay on your machine.

## Questions people also ask

**Does this slow down Claude Code?**

No. The gateway works in milliseconds. You only wait when a risky move hits the approval inbox.

**Can I set different limits for different projects?**

Yes. Policies are local to your machine and apply to every tool call the agent makes.


## Sources

- GainWix — Security — https://gainwix.ai/security/ (checked 2026-09-07)

---

GainWix AI Studio is a free desktop download: https://gainwix.ai/download/

Work with AI that works with you.
