How to Configure OpenHands Oracle Credentials

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up openhands oracle credentials by passing database login keys to the agent workspace. You then scope the database role to limit what tables the agent can read. Engineering teams often start by sharing a broad developer account with the AI agent. That choice speeds up early testing, but it exposes live data to automated mistakes. If an autonomous agent holds write permissions, a single bad query can drop tables. Scoping the database account is the first step toward safe agent execution.

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 openhands oracle credentials by passing database login keys to the agent workspace. You then scope the database role to limit what tables the agent can read. Engineering teams often start by sharing a broad developer account with the AI agent. That choice speeds up early testing, but it exposes live data to automated mistakes. If an autonomous agent holds write permissions, a single bad query can drop tables. Scoping the database account is the first step toward safe agent execution.

How openhands oracle credentials work in practice

OpenHands runs tasks inside an isolated workspace container to write code and run commands. When a task requires data checks, the agent reads login secrets from its local space. It uses these keys to log in a session with the Oracle database instance. The database checks the username and password or wallet file during the initial login. Once verified, the database assigns a specific role to that active agent session. Every query the agent sends runs under the permissions tied to that single role.

To keep this setup safe, admins create a dedicated user account just for the agent. They strip away admin rights and grant read permissions only on safe tables. Teams also avoid storing plain text passwords inside project files or git repos. Instead, they load the secret keys into the workspace only when a run starts. When the agent finishes its task, the workspace shuts down and wipes the local keys. This flow keeps static passwords out of source code while allowing automated database checks.

What native database roles solve and what they miss

Native database roles do a good job of controlling who can log in. They also define which schemas and tables a specific user account can read or change. By setting up a read-only role, you stop the agent from deleting core records. You can also block the agent from viewing sensitive HR or finance schemas entirely. For basic database security, role-based rules form a strong and necessary foundation.

Still, static roles cannot inspect what an individual query does while it runs. Once a session starts, the database trusts every command that passes the basic table check. An agent with read permissions on a customer table can still pull every row by default. That query pulls emails, phone numbers, card numbers, and national IDs into the workspace. The agent then sends those raw query results straight to an external model provider. Native roles also lack a clear way to tie queries back to specific tasks. Database logs only show the shared agent account, not the human who triggered the run.

Ephemeral Credentials + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Best practices for scoping agent database sessions

Start by creating a separate database role for each distinct agent workflow you run. Never let an automated coding agent share a login with a human software engineer. Limit the agent role to specific views rather than full base tables when possible. Views let you hide sensitive columns before the agent even runs a select statement.

You should also set resource limits on the Oracle profile tied to the agent. Cap the number of concurrent sessions and limit the CPU time per query call. This stops a confused agent from running a massive join that locks up production. Finally, rotate the agent login keys on a regular schedule to reduce exposure risk. Combine these native database controls with runtime checks to keep your data safe.

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 runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values 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

Should OpenHands use a shared developer account for Oracle?

No, sharing a human account makes it hard to track what the agent did. Always create a dedicated database user with strict read-only permissions for agent tasks.

How can I stop the agent from reading sensitive customer columns?

You can restrict the database role to read from curated database views only. Another option is to use runtime data masking to rewrite matched fields in results.

What happens if an AI agent runs a slow query on Oracle?

A heavy query can consume CPU and slow down the database for other users. Set strict query timeout limits on the database profile assigned to the agent role.

The query runs. The emails stay hidden.