How to Configure OpenHands Oracle Audit Log

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up an openhands oracle audit log by enabling database auditing for the agent role. Then you route those audit records to your central log store for review. Most teams give their coding agents a single shared database role to run queries. When that role has broad permissions, one bad prompt can change or read production data. How the openhands oracle audit log workflow operates OpenHands runs as an autonomous software agent inside its own workspace container. Engineers give the agent a

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 an openhands oracle audit log by enabling database auditing for the agent role. Then you route those audit records to your central log store for review. Most teams give their coding agents a single shared database role to run queries. When that role has broad permissions, one bad prompt can change or read production data.

How the openhands oracle audit log workflow operates

OpenHands runs as an autonomous software agent inside its own workspace container. Engineers give the agent a task, and the agent writes code or runs shell commands. When the task needs database state, the agent starts a session with Oracle. It uses credentials stored in the workspace to log in as a specific database user.

Inside Oracle, unified auditing tracks what that specific database user does during each session. Admins create an audit policy that watches actions from the agent role. You can tell the policy to record failed logins, table reads, or schema changes. Oracle writes these events to an internal audit trail table as the agent works.

Security teams then ship those records out of the database into a log tool. This lets the team see which SQL statements the agent ran and when. You should also tag the session metadata with the task ID from the agent. Without session tags, every query from different tasks looks the same in the log.

What native database auditing solves and what it misses

Native database auditing gives you a clear history of what happened after a run. It proves which role ran a query and shows the time of the event. If an agent drops a table, the log shows the exact statement that caused damage. This helps teams pass audits and investigate incidents after an error occurs.

Still, a database log only records actions after the database runs them. Static roles decide who can log in, not what individual statements do in flight. If the agent role has write permissions, nothing stops a bad update statement. The audit trail will record the mistake, but the production data is already gone.

Audit Log Integrity + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Native logs also do not stop sensitive data from entering the agent context window. When an agent runs a broad select query, raw rows return to the workspace. Those rows might hold emails, phone numbers, card numbers, or national IDs. The agent then sends those raw values to an external language model during its run. Masking rules that rewrite matched fields in results help reduce this exposure before models process data.

Best practices for agent database roles and logs

Start by creating a dedicated Oracle user account just for your automated coding agents. Never let an agent log in with a human admin role or shared app account. Give this agent role read permissions on only the specific views it needs. Block the role from reading sensitive user tables or system catalogs by default.

Next, set your audit policy to log both successful and failed statements from that role. Failed queries often show when an agent is stuck in a loop or guessing schemas. Review these logs each week to tighten permissions and spot risky agent prompts early. Keep the audit trail permissions separate so the agent role cannot alter its own logs.

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

Can OpenHands read the Oracle audit trail directly?

It only reads the trail if you grant the agent role select permissions on audit views. You should block the agent from reading or changing audit tables to keep logs safe.

How do we link a database log entry to a specific agent task?

Have the agent script set client info attributes in the database session before running queries. Oracle records those session attributes inside the audit trail alongside the SQL statement.

Does database auditing stop an agent from reading sensitive columns?

No, auditing only writes down that the read happened after the query finishes. To hide sensitive fields like card numbers or emails, you need runtime data masking.

The query runs. The emails stay hidden.