---
title: "Contextual Policies in Omnigent: Using session state to better govern AI agents"
description: "Omnigent, an open-source meta-harness for AI agents, introduces contextual policies to make agent controls safer and less disruptive than per-action allow, deny, or approval rules. Policies receive session events, maintain private state such as tools used, documents read, accumulated risk, initial intent, and model spend, then allow, deny, transform, or escalate the next action. Omnigent’s server intercepts tool calls from supported agents and applies these policies consistently, while examples include Google Drive restrictions based on documents created or marked confidential, risk thresholds that require approval for later email or file-sharing actions, and budget thresholds that pause or redirect work to a cheaper model. Intent-based authorization limits tools according to the user’s opening request, applying least privilege across supported harnesses and custom agents. The project is described as open source and alpha, with the server providing one interception layer for agents using different harnesses."
---

# Contextual Policies in Omnigent: Using session state to better govern AI agents

[Databricks](https://yomu.fyi/company/databricks) · Matei Zaharia, David Nasi, Xiangrui Meng, Kecheng Cao, Tomu Hirata · Jul 7, 2026

**Type:** Explainer

## Summary

Omnigent, an open-source meta-harness for AI agents, introduces contextual policies to make agent controls safer and less disruptive than per-action allow, deny, or approval rules. Policies receive session events, maintain private state such as tools used, documents read, accumulated risk, initial intent, and model spend, then allow, deny, transform, or escalate the next action. Omnigent’s server intercepts tool calls from supported agents and applies these policies consistently, while examples include Google Drive restrictions based on documents created or marked confidential, risk thresholds that require approval for later email or file-sharing actions, and budget thresholds that pause or redirect work to a cheaper model. Intent-based authorization limits tools according to the user’s opening request, applying least privilege across supported harnesses and custom agents. The project is described as open source and alpha, with the server providing one interception layer for agents using different harnesses.

## Context

Existing agent frameworks mainly offer simple allow-list, deny, or per-action approval controls. The post identifies security and cost-management cases where an action’s safety depends on prior session activity, including prompt injection risk, cumulative exposure to sensitive material, excessive messaging, and model spend.

## Approach / What changed

Omnigent policies observe agent events and retain policy-specific session state on the server. A policy handler receives prior state and the next event, then returns state updates and a decision to allow, deny, transform messages, or ask the user for permission. The same layer applies across supported and custom agent harnesses.

## Takeaways

- The Google Drive policy confines writes to documents created during the session by default and applies a no-write-down rule after the agent reads a confidential document.
- The cost policy asks for approval after a soft spending threshold and blocks further calls to an expensive model at a hard cap until the agent switches to a cheaper one; a per-user daily cap can also be layered on top.
- Intent-based authorization stores the user’s initial request and checks each tool call against it, allowing a session focused on Google Slides to block unrelated GitHub access.

**Tags:** [AI Agents](https://yomu.fyi/topic/ai-agents), [AI Governance](https://yomu.fyi/topic/ai-governance), [AI Security](https://yomu.fyi/topic/ai-security), [Open Source](https://yomu.fyi/topic/open-source)

- Source: [Databricks](https://www.databricks.com/blog/contextual-policies-omnigent-using-session-state-better-govern-ai-agents)
- Source URL: https://www.databricks.com/blog/contextual-policies-omnigent-using-session-state-better-govern-ai-agents
- Ingested by Yomu: 2026-08-30T16:59:06.377Z

[Read original post](https://www.databricks.com/blog/contextual-policies-omnigent-using-session-state-better-govern-ai-agents)
