How to Configure OpenHands Oracle Prevent Delete
You set up an openhands oracle prevent delete rule by limiting database user privileges. You also add workspace command checks before the AI agent runs queries. Many teams start by giving the agent a shared login with broad write rights. When an AI agent holds full table permissions, one bad prompt can wipe production rows. A solid setup removes drop and delete rights from the database role itself. How an openhands oracle prevent delete setup works OpenHands runs tasks inside a sandboxed cont
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 prevent delete rule by limiting database user privileges. You also add workspace command checks before the AI agent runs queries. Many teams start by giving the agent a shared login with broad write rights. When an AI agent holds full table permissions, one bad prompt can wipe production rows. A solid setup removes drop and delete rights from the database role itself.
How an openhands oracle prevent delete setup works
OpenHands runs tasks inside a sandboxed container where it writes code and runs terminal commands. When the agent needs to fix data or check schemas, it starts a database session. To stop row removal in Oracle, database admins build a custom role for the agent. This role grants select, insert, and update privileges on specific tables while withholding delete rights. Admins also withhold table drop and truncate permissions from this dedicated agent account. If the agent sends a delete command, the database engine blocks the statement right away.
Teams also use database triggers and views to add another layer of safety. A before-delete trigger on key tables can reject row removal attempts and log the event. Or, admins let the agent read and write through restricted views instead of base tables. Inside the OpenHands workspace, engineers also set up agent instructions and shell wrapper scripts. These local checks scan outgoing SQL text and stop scripts that contain destructive words. Combining database role limits with workspace checks keeps agent runs much safer.
What native database roles solve and what they miss
Native Oracle privileges do a great job of blocking direct delete statements at rest. Once you revoke delete permissions from the agent role, direct row removal will fail. This setup decides which user account can log in and which tables it can touch. It provides a reliable baseline for teams that run automated coding agents against test data. You do not need to trust the AI model to follow text prompt rules alone.
Still, static database roles leave big operational gaps during live agent runs. A role decides who logs in, not what individual statements do in flight. For example, an agent with update rights can overwrite every row with blank values. An agent can also call a stored procedure that deletes data under the owner's permissions. Static roles cannot pause a risky update to ask a human for approval first. They also cannot rewrite sensitive fields like emails, phone numbers, or card numbers in results. Finally, database logs only show the shared agent login, hiding which prompt triggered the query.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Best practices for safe AI database sessions
Start by giving your AI agent its own unique login in the Oracle database. Never share human admin credentials or app service accounts with an autonomous coding tool. Map out the exact tables the agent needs to read or change for its task. Grant permissions on those tables one by one instead of using broad system roles.
Next, replace hard deletes with soft delete patterns in your database schema design. Let the agent update a status column to mark rows inactive instead of removing them. Test your agent role in a staging sandbox before you point it at real data. Review your database audit logs every week to spot blocked queries and odd update patterns.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can prompt rules alone stop OpenHands from deleting Oracle rows?
No, prompt rules are only guidelines that the AI model might ignore during complex tasks. You must revoke delete permissions on the Oracle role to block row removal for sure.
How can an agent remove data if delete rights are revoked?
An agent with update rights can still set column values to null across an entire table. It can also run stored procedures that execute delete commands using the procedure owner's permissions.
Should OpenHands use the same Oracle role as our main app?
No, your main app role likely has delete and schema change rights that agents should lack. Always build a separate, restricted database role just for your AI agent sessions.
Related guides
In this post