How to Configure Claude Code Oracle Read Only Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up claude code oracle read only permissions by creating a restricted database user. Then you pass that user role into your Model Context Protocol server setup. Many engineering teams start by giving their coding agent a standard developer login. That approach creates high risk when an automated tool runs queries against live data. If the role has write rights, one bad prompt can drop rows or alter schemas. Scoping the database account down to read rights is the mandatory first step. Ho

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 oracle read only permissions by creating a restricted database user. Then you pass that user role into your Model Context Protocol server setup. Many engineering teams start by giving their coding agent a standard developer login. That approach creates high risk when an automated tool runs queries against live data. If the role has write rights, one bad prompt can drop rows or alter schemas. Scoping the database account down to read rights is the mandatory first step.

How claude code oracle read only permissions work in practice

Claude Code reaches outside systems and databases through two main paths. The first path uses the Model Context Protocol, which links the agent to databases. Official docs tell teams to put a read-only database user in the setup string. That way, the queries the agent runs cannot change or delete any stored data. The second path uses the built-in Bash tool to run local shell commands. In Manual mode, the Bash tool asks for human approval before running most commands. Only a small built-in list of safe read commands runs without a prompt.

To set up your Oracle role for the agent, start inside the database itself. A database admin creates a dedicated account just for the AI coding agent. The admin grants that account session rights and select rights on specific views or tables. The admin leaves out insert, update, delete, and drop rights on every schema. Next, the developer configures the local MCP server with those restricted login credentials. When the agent asks to inspect a table, the MCP server uses that read-only session. If the agent tries to run a write statement, the database rejects the command.

Why database roles alone leave an operational gap

A read-only role stops the agent from changing data or dropping a table. Still, database roles only check who logs in and which tables they can read. They do not inspect what individual queries do in flight during an active session. A read-only user can still read every column inside an allowed customer table by default. That means a single select query can pull emails, phone numbers, and card numbers. Those sensitive fields then flow straight into the model context window and local logs. Data masking is needed to rewrite matched fields in results before they reach the client.

Local credential storage creates a second problem for security and platform teams. To use an MCP server or Bash tool, the developer stores credentials on their laptop. Those static passwords or keys sit in plain text files on the local disk. If a developer leaves the team, someone must rotate that shared database password by hand. Also, every developer using that shared read-only account looks identical in the database logs. When an expensive query slows down the database, admins cannot see which person ran it. Teams need per-user identity attribution and field-level controls on every query in flight.

Claude Code Security + Read-Only Root Filesystem: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

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

How does Claude Code query an external database?

It queries databases through an MCP server or by running CLI tools in Bash. Vendor docs recommends using a read-only database user in the MCP setup string.

Does Manual mode stop the agent from running database queries?

Manual mode requires user approval for Bash commands outside a small safe list. Still, once you approve a command or MCP tool, the database role controls the query.

Can a read-only Oracle role prevent sensitive data exposure?

No, a read-only role still returns all columns inside any permitted table or view by default. Without query-level masking, queries can return raw emails, phone numbers, and national IDs.

The query runs. The emails stay hidden.