Skip to content
aiqbenchAI & Quantum Intelligence
NewsInsightsBenchmarksSkillsAsk AILearnAbout
...Loading your session
NewsInsightsBenchmarksSkillsAsk AILearnAbout
Back to list
aiqbench takeAI Safety

aiqbench analysis

The integration of OpenShell's sandboxed runtime with Databricks Lakewatch establishes a defensive perimeter for autonomous coding agents, preventing them from executing malicious instructions or accessing unauthorized data within enterprise lakehouses. This architecture enforces strict policy controls on file access, network calls, and credential handling, effectively isolating agent behavior from the broader organizational infrastructure while maintaining necessary connectivity to remote services.
1
Source coveringDatabricks

Securing Coding Agents with OpenShell and Databricks Lakewatch

Databricks·December 1, 2026·10 min read

From Databricks

Full text

1. Start with the developer's task

A developer asks a coding agent to update a data pipeline, run tests, and prepare a pull request. The code lives in a local repository, while the data needed to validate the change lives in Databricks. The developer wants to work in a familiar coding environment with powerful AI models while accessing the organization's Lakehouse for context and output storage.

That workflow crosses several security boundaries. The agent reads repository files and issues descriptions, executes code locally, and calls remote tools and services. Instructions embedded in those materials could attempt to redirect it toward exposing credentials, sending data to an unexpected destination, or accessing resources outside its assigned task.

OpenShell is an open-source secure runtime for running AI agents in sandboxed environments with policy-controlled access to files, credentials, and networks. The proposed reference workflow combines OpenShell runtime controls for a locally running coding agent, Databricks governance for remote data access, and Databricks Lakewatch for investigating related security signals. The goal is to connect what the developer asked the agent to do with what it attempted, what each system permitted, and what response is appropriate.

2. Follow the coding workflow and its control boundaries

Consider an agent working on a repository change and running SQL queries against authorized development data in a Databricks Lakehouse. The agent runs locally inside the OpenShell runtime and calls a configured model inference endpoint. The agent's execution location and the model's serving location are separate parts of the design.

Now suppose an issue description contains malicious instructions to export credentials or query a restricted production table. These are separate actions with separate enforcement points. An outbound request outside the configured policy can be denied by OpenShell. A data request outside the authenticated identity's permissions can be denied by Databricks. Each outcome contributes evidence for investigation.

OpenShell applies the configured filesystem and network policies around the local agent. Databricks authenticates its requests, and Unity Catalog applies the permissions of the user or service principal making them. The agent's model calls go through Unity AI Gateway, which records every prompt and response — the earliest evidence in an investigation. Lakewatch investigates the security sources collected for the workflow. Any response requires an authorized operator or separately configured responder.

3. Detect and investigate in Lakewatch

The developer doesn't notice any of this. The agent reports that it couldn't push and that its query was refused, which appears to be a typical permissions issue. Each denial did leave a record, though. OpenShell wrote events for the blocked push and the blocked outbound connection, and Unity Catalog wrote audit entries for the rejected production query and the rejected DROP. Lakewatch pulls in both streams and runs detection rules over them.

One denial by itself might just be a misconfigured policy. The same agent trying to push to main, read a production table, drop a shared one, and open a connection to an outside host, all inside a few minutes, is an attack path worth investigating.

Critical data sources

Lakewatch collects the telemetry from this environment and supports detection and investigation. OpenShell's native OCSF events record every network connection the agent attempted, the policy decision, and the process that initiated the request. The Unity Catalog audit log, SQL query history, and table lineage, all from Databricks system tables, record SQL queries and updates in the Lakehouse.

Detection

Lakewatch brings the signals for the whole sequence in one place. The earliest evidence is in the agent's calls to its model, which go through Unity AI Gateway. When the agent reads the malicious issue and sends it to the model, the injected instructions appear in the Gateway payload. OpenShell's events then show the agent trying to push to a read-only repository and trying to connect to an external host. Databricks system tables indicate attempts to drop a production table.

Figure 1. Detection examples from the earlier demonstration cover outbound requests, attempted writes, identity, and model activity. Rule status and synthetic test coverage are shown in their…
Figure 1. Detection examples from the earlier demonstration cover outbound requests, attempted writes, identity, and model activity. Rule status and synthetic test coverage are shown in their original context.

From an alert to the agent's activity

The Lakewatch alert gives the analyst a starting point. It names the agent, its sandbox, and the person who owns it, and it lists the signals behind it in the order they happened, from the malicious text in the Gateway payload to the blocked push and the refused queries. Each signal links to the underlying event, so the analyst can read the issue text the agent sent to the model, see the model's reply, and confirm what OpenShell and Unity Catalog each refused.

The runbook attached to the alert says what to check and what to do next. For anything the alert doesn't answer, Triage with Genie opens a natural-language session over the same data, so a question like "what else did this agent read today" doesn't require writing SQL.

Figure 2. A live Lakewatch incident from the demonstration workspace. The injected instructions appear in the AI Gateway record alongside the blocked egress, the denied table read, and the automatic…
Figure 2. A live Lakewatch incident from the demonstration workspace. The injected instructions appear in the AI Gateway record alongside the blocked egress, the denied table read, and the automatic quarantine response in the activity log.

Custom dashboards

Everything Lakewatch collects lives in tables in Unity Catalog, so the same data that drives the alerts is available to Databricks dashboards. This demo includes one that steps back from a single alert to the whole fleet of agents. It lists each agent with its owner, the task it was given, and what it actually did. A response log underneath records what was done about each alert and when. A security lead can see at a glance which agents are behaving as expected, which ones are being steered, and how long it took to act.

Figure 3. The agent activity dashboard, built with Databricks AI/BI on the same tables Lakewatch uses, showing expected task against observed behavior, allowed and blocked actions over time, the…
Figure 3. The agent activity dashboard, built with Databricks AI/BI on the same tables Lakewatch uses, showing expected task against observed behavior, allowed and blocked actions over time, the action ledger, and the response log.

Workflow recap: connect coding activity and investigation

  1. A coding agent in an OpenShell sandbox takes a repository task and reads the issue.
  2. Its model calls go through Unity AI Gateway, which records every prompt and response.
  3. It runs SQL queries against governed development data in Databricks.
  4. OpenShell policy governs what leaves the sandbox; Unity Catalog applies its identity's permissions to the data.
  5. Lakewatch collects OpenShell events, Gateway payloads, and Databricks audit/query records.
  • OpenShell governs the agent in its configured sandbox.
  • Unity AI Gateway records the model path.
  • Unity Catalog applies permissions to the authenticated user or service principal.
  • Lakewatch provides security investigation over configured telemetry.

Configure a collection path appropriate for the required retention, and verify that the events needed for investigation are available and current.

4. Prepare the coding workflow

Prepare a local environment supported by OpenShell, a compatible coding agent, and a configured model inference endpoint. Confirm access to the required Databricks services, governed development data, and Lakewatch. Use synthetic or otherwise authorized test data and define the agent identity, permitted destinations, and response responsibilities.

  • Configure the agent's OpenShell policy and its authenticated Databricks access. Grant only the permissions needed for the development task.
  • Run an approved repository task and SQL tests against the development data. Record the agent identity and the available query or request identifiers.
  • Collect OpenShell security events and relevant Databricks audit and query records. Check their timestamps, identity mappings, and collection freshness before investigating them in Lakewatch.

The earlier demonstration loaded some telemetry manually and used a custom Databricks dashboard. Verify collection and correlation for the coding workflow before relying on its alerts. A collector, dashboard, or responder built for the example should be documented separately from native Lakewatch functionality. Reusable dashboard and skill packaging remain in development.

  • Begin with an analyst-led investigation and an authorized response.
  • Test any separately configured responder with the permissions and recovery checks the deployment requires.

With the security owner's approval, exercise a controlled scenario involving an unauthorized destination or restricted data request. Compare attempted actions with actual outcomes and validate the response on the same agent session.

5. Verify containment and recovery

An investigation should lead to a response that is authorized, attributable, and verifiable. Depending on the incident, an authorized operator or configured responder may stop the local agent, restrict its access, revoke a credential, or cancel associated remote work. Each action requires the appropriate permissions and confirmation from the system enforcing it.

  1. Identify the affected agent, its owner, and the related Databricks activity. Preserve the source events.
  2. Authorize the response, then verify each action at the system that enforces it.
  3. Restore approved work deliberately and verify a clean run while retaining the incident evidence.

What is validated, and what isn't. In the training demo, the full loop ran live: Lakewatch tied the blocked actions and the injected text into one incident, and the response fired on its own — it stopped the agent and cancelled its job. The coding workflow in this post hasn't run that loop yet, so start there with a human-approved response.

Stopping the local OpenShell environment does not automatically terminate work already running in Databricks. Where remote work exists, check its status separately and confirm any requested cancellation. OpenShell continues to enforce its configured runtime policies independently of Lakewatch detection and any subsequent action.

After containment, rerun the authorized coding task and confirm that the controls still permit the intended workflow.

“AI agents are becoming part of how teams work with data and models. Bringing security signals and governed context together helps organizations investigate what those agents are doing and make informed decisions about the next action.”- Stephen Orban, SVP Product Partnerships and Ecosystem, Databricks

6. Make every security decision traceable

For this workflow, assign ownership across the local agent environment and the remote Databricks services. The roles below describe the reference design; response actions require separately configured permissions and validation.

CapabilityLocal agentRemote platform
ExecutionOpenShell sandboxSQL queries and services
AccessSandbox policyUnity Catalog
IdentityAgent credentialsUser or service principal
EvidenceOpenShell eventsAudit and query records
InvestigationCollected agent eventsLakewatch investigation
ResponseAuthorized local responseAuthorized remote response

The practical outcome is a traceable decision: which agent acted, what it attempted, which resources were affected, and whether the authorized response succeeded.

Adapt the policies, permissions, telemetry, and response process to the organization's approved models, data, and incident procedures.

7. Conclusion

A coding agent that works against real systems needs limits that live outside the agent, because instructions can arrive from anything the agent reads. In this workflow, OpenShell contains the agent at runtime, Unity AI Gateway records the model path, Unity Catalog governs what its identity may touch, and Lakewatch turns those records into one investigation. The same pattern holds beyond coding agents: it applies to any agent acting on enterprise data. Start with the reference workflow, validate containment with your security owner, and bring it to your agents one boundary at a time.

Explore OpenShell and contact your Databricks account team about Lakewatch access and the coding agent reference workflow. Confirm the current availability and setup guidance before beginning an evaluation.

FAQs

What does OpenShell control in this architecture?

OpenShell applies configured controls around the local coding agent, including filesystem and network policies. Databricks separately enforces access to its remote resources.

What does Unity Catalog contribute?

Unity Catalog governs access to configured data and supported assets in Databricks. Requests from the coding workflow are evaluated using the permissions of the authenticated user or service principal.

Is Lakewatch generally available?

Lakewatch is currently in Beta. Contact your Databricks account team for current availability and access requirements.

Does Lakewatch automatically quarantine the agent in this example?

See "What is validated, and what isn't" in section 5. Begin with a human-approved response in the coding workflow.

Does the model need to run on the developer's laptop?

The coding agent's execution environment and its model inference endpoint are separate parts of the architecture. Configure a compatible, approved endpoint and the required network access. The reference design does not require the model itself to run locally.

Full text under the publisher's open licence · 1992 words

Read at Databricks ↗Ask about this article

Article info

Source

Databricks

Published

December 1, 2026

Read time

10 min

Category

AI Safety
aiqbench
AI & Quantum Intelligence© aiqbench. All rights reserved.

Feeds:RSS·JSON Feed

LanguageEnglish·Românăbeta
NewsAI & TechQuantumInsights
ExploreBenchmarksLearn
CompanyAboutTrustLegal noticeTerms of ServicePrivacy PolicyCopyright noticesData erasureReport content

The aiqbench take, the insights, the daily digest and Ask answers are written by AI models from the sources shown, without editorial review before publication. They may contain errors — check the source. How the model is used →

  • News
  • Insights
  • Ask AI
  • Benchmarks
  • Account