How to Configure Claude Code Redis Approval
You set up claude code redis approval by turning on Manual mode for shell commands. You also limit database permissions by assigning a read-only user role to the agent. Engineering teams often pair AI coding tools with local or remote data stores. When developers give an agent broad write permissions, a bad command can delete live keys. Setting strict boundaries stops the AI from making bad changes on its own. How claude code redis approval works in practice Claude Code reaches external syste
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up claude code redis approval by turning on Manual mode for shell commands. You also limit database permissions by assigning a read-only user role to the agent. Engineering teams often pair AI coding tools with local or remote data stores. When developers give an agent broad write permissions, a bad command can delete live keys. Setting strict boundaries stops the AI from making bad changes on its own.
How claude code redis approval works in practice
Claude Code reaches external systems and databases through two main paths. The first path uses the built-in Bash tool to run shell commands. In Manual mode, the agent asks the user to approve each shell command before it runs. Only a small built-in list of safe read commands can run without a prompt. When the agent tries to invoke a database client in the shell, it pauses. The developer must read the command and approve it on their screen.
The second path uses the Model Context Protocol, also known as MCP. MCP servers let the agent query databases and APIs through structured tools. Vendor docs warn teams to verify they trust each MCP server before use. The docs also tell users to put a read-only database user in the setup string. That way, the queries the agent runs cannot change or delete stored data.
What native permissions solve and what they leave open
Combining Manual mode with a read-only database role solves the biggest risk of accidental writes. A read-only user role blocks the agent from flushing keys or overwriting values. Manual shell prompts give the developer a chance to stop bad scripts before they start. These native settings decide who can log in and which broad role they hold.
Still, static user roles and local prompts leave a big operational gap open. Database roles apply to the whole session, not to single commands in flight. If an agent needs to write one key, the team must grant write permissions. Once the agent has a write role, every query in that session carries write power. Developers also get tired of reading dozens of local prompts and may click approve too fast.
Claude Code Security + Approval Chains & Escalation: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Why local prompts are not enough for sensitive data
A read-only role stops data loss, but it does not stop data leaks. Production caches and key stores often hold personal user details in plain text. When an agent runs a read query, the database returns the full record. That response might include emails, phone numbers, card numbers, or national IDs. Static database roles cannot rewrite those matched fields in the query results.
Local shell prompts also lack a central audit log for the security team. When a developer approves a command on their laptop, only that laptop sees the choice. Team leads cannot review who approved a sensitive command or what data came back. To fix this, teams need checks that inspect each command and mask sensitive fields in flight.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Does Claude Code run database commands without asking?
In Manual mode, the Bash tool asks for approval before running non-basic shell commands. If you use an MCP server, tool prompts depend on your local client settings.
How do I stop the agent from deleting Redis keys?
Assign a read-only user role in the database setup string given to the agent. This blocks any command that tries to alter, overwrite, or delete stored keys.
Can database roles hide personal data from the AI agent?
No, standard database roles only control which commands a user can run. They do not mask emails, phone numbers, or card numbers inside the results of allowed reads.
Related guides
In this post