> ## Documentation Index
> Fetch the complete documentation index at: https://www.osohq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Policies

> Define rules that control what AI agents are allowed to do across your organization.

Policies let you control what agents can do. Set conditions to match specific agent activity, then choose what happens when it matches: alert your team, enforce a restriction, or both.

## Writing a policy

A policy has conditions, grouped into three fields - **Actor**, **Operation**, and **Resource** - and a **Response** for what Oso does when it matches. Only Actor and Response are required; Operation and Resource conditions are optional and addable.

### Actor

Who's involved:

* **Agent name** - a specific agent, like Claude or Codex
* **Agent review status** - Unreviewed, Allowed, or Disallowed

If you've connected an [identity provider](/docs/oso-for-agents/identity-sync), you can also match on the user or group driving the agent.

### Operation

What kind of call it is:

* **Type** - the kind of operation: Read, Write, Destructive, or Unknown
* **Tools** - one or more specific tools, searchable, each tied to its integration (Gmail, GitHub, etc.); tools with no known integration show up as **Unclassified**
* **Connectors** - matches every call made through a specific CLI or MCP integration point (for example, Linear accessed through Claude.ai's MCP connector)

### Resource

What it touches:

* **Provider** - the upstream system a tool belongs to (GitHub, Gmail, etc.), or all providers
* **Content type** - matches a [content tag](/docs/oso-for-agents/content-tags) you've defined (for example, "PHI" for a healthcare company) - scans both the request and the response

### Response

Choose Alert, Enforce, or both:

* **Alert** - notify your team. Set a severity (Low, Medium, High, Critical) and a cadence (every time, or throttled to once every 5 minutes, 15 minutes, 30 minutes, 1 hour, or 24 hours). Alerts route to the Slack channel you've already connected under Connections.
* **Enforce** - restrict the matching call. Choose one:

  * **None - monitor only**
  * **Block** - prevent the call from proceeding. For a policy that scans a tool's response (a content-type condition), the call has already run by the time it's scanned, so Block instead redacts the response.
  * **Require user approval** - pause until the end user allows or denies it.
  * **Require security approval** - block until your security team grants a one-time exception.

  Add a message when you enforce - it's shown to the agent or user when the policy triggers.

<Note>
  Content-type conditions support Alert as usual, but Enforce is limited to **Block** - content that's already entered the model's context can't be held for user or security approval.
</Note>

### Policy preview

As you build a policy, the preview panel shows exactly how it'll behave:

* **Runs on** - which event types the policy is evaluated against, derived automatically from your conditions: a policy scoped to a specific tool (by Type, Tools, Connectors, or Provider) runs on the tool request; add a Content type condition to that same policy and it also runs on the tool response; a policy with no tool-scoping condition (matching only on Actor or Content type) runs on all three - user prompt, tool request, and tool response
* **Matches** - the specific tools and agents the policy currently matches
* **Then** - the resulting action

For example, a policy that blocks destructive actions from approved agents shows **Runs on: Tool request**, **Matches**: every destructive tool and your allowed agents, and **Then: Blocks the tool call**.

## Supported integrations

This isn't exhaustive - Oso supports more integrations than shown here, with new ones added regularly.

<div style={{display: "flex", flexWrap: "wrap", gap: "12px", alignItems: "center", justifyContent: "center", margin: "16px 0"}}>
  <img src="https://mintcdn.com/osoinc/cYMS27IAOLqEra6m/images/integrations/logos/github.svg?fit=max&auto=format&n=cYMS27IAOLqEra6m&q=85&s=77274203c0a609d364de7b62671ab03b" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="GitHub" title="GitHub" width="16" height="16" data-path="images/integrations/logos/github.svg" />

  <img src="https://mintcdn.com/osoinc/cYMS27IAOLqEra6m/images/integrations/logos/atlassian.svg?fit=max&auto=format&n=cYMS27IAOLqEra6m&q=85&s=f9f864faf4a385f16244d260bbd06c2e" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Atlassian" title="Atlassian" width="48" height="48" data-path="images/integrations/logos/atlassian.svg" />

  <img src="https://mintcdn.com/osoinc/cYMS27IAOLqEra6m/images/integrations/logos/notion.svg?fit=max&auto=format&n=cYMS27IAOLqEra6m&q=85&s=fd9dbb50de02dcae11b91f6bd7e1ced9" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Notion" title="Notion" width="800" height="800" data-path="images/integrations/logos/notion.svg" />

  <img src="https://mintcdn.com/osoinc/cYMS27IAOLqEra6m/images/integrations/logos/google_drive.png?fit=max&auto=format&n=cYMS27IAOLqEra6m&q=85&s=ddfc6d631ad0563da8a9e25ad3a227ac" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Google Drive" title="Google Drive" width="330" height="295" data-path="images/integrations/logos/google_drive.png" />

  <img src="https://mintcdn.com/osoinc/cYMS27IAOLqEra6m/images/integrations/logos/gmail.png?fit=max&auto=format&n=cYMS27IAOLqEra6m&q=85&s=6d7b6e257714c98f355d5d1971d35d55" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Gmail" title="Gmail" width="330" height="248" data-path="images/integrations/logos/gmail.png" />

  <img src="https://mintcdn.com/osoinc/cYMS27IAOLqEra6m/images/integrations/logos/linear.svg?fit=max&auto=format&n=cYMS27IAOLqEra6m&q=85&s=0171ea09be200893f5ba2be6c19c30ea" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Linear" title="Linear" width="24" height="24" data-path="images/integrations/logos/linear.svg" />

  <img src="https://mintcdn.com/osoinc/cYMS27IAOLqEra6m/images/integrations/logos/dropbox.svg?fit=max&auto=format&n=cYMS27IAOLqEra6m&q=85&s=7e0be549dc65098502cb3e06c992d304" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Dropbox" title="Dropbox" width="64" height="64" data-path="images/integrations/logos/dropbox.svg" />

  <img src="https://mintcdn.com/osoinc/cYMS27IAOLqEra6m/images/integrations/logos/datadog.svg?fit=max&auto=format&n=cYMS27IAOLqEra6m&q=85&s=3e25c55e7c6e09f502df0eefd1ad797d" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Datadog" title="Datadog" width="800" height="800" data-path="images/integrations/logos/datadog.svg" />

  <img src="https://mintcdn.com/osoinc/cYMS27IAOLqEra6m/images/integrations/logos/git.svg?fit=max&auto=format&n=cYMS27IAOLqEra6m&q=85&s=0d24bd80415b17b490ad13d55898b3dd" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Git" title="Git" width="800" height="800" data-path="images/integrations/logos/git.svg" />

  <img src="https://mintcdn.com/osoinc/HPHZK-kunCS5MlpO/images/integrations/logos/zoom.svg?fit=max&auto=format&n=HPHZK-kunCS5MlpO&q=85&s=37ec2bddde6e70f7dcd50f623f38d8be" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Zoom" title="Zoom" width="512" height="512" data-path="images/integrations/logos/zoom.svg" />

  <img src="https://mintcdn.com/osoinc/HPHZK-kunCS5MlpO/images/integrations/logos/intercom.svg?fit=max&auto=format&n=HPHZK-kunCS5MlpO&q=85&s=5b3eae7c141e8a691c12e1f0c53627be" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Intercom" title="Intercom" width="36" height="37" data-path="images/integrations/logos/intercom.svg" />

  <img src="https://mintcdn.com/osoinc/HPHZK-kunCS5MlpO/images/integrations/logos/miro.svg?fit=max&auto=format&n=HPHZK-kunCS5MlpO&q=85&s=30182799f9dcb149683052e7c7e81964" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Miro" title="Miro" width="320" height="320" data-path="images/integrations/logos/miro.svg" />

  <img src="https://mintcdn.com/osoinc/HPHZK-kunCS5MlpO/images/integrations/logos/box.svg?fit=max&auto=format&n=HPHZK-kunCS5MlpO&q=85&s=ee0f603c83685dba30ffbda73de7f323" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Box" title="Box" width="512" height="512" data-path="images/integrations/logos/box.svg" />

  <img src="https://mintcdn.com/osoinc/HPHZK-kunCS5MlpO/images/integrations/logos/amplitude.svg?fit=max&auto=format&n=HPHZK-kunCS5MlpO&q=85&s=da973bfbbb81ed1522ea13cd41edd1c5" style={{height: "34px", width: "34px", backgroundColor: "white", borderRadius: "6px", padding: "4px"}} alt="Amplitude" title="Amplitude" width="32" height="32" data-path="images/integrations/logos/amplitude.svg" />
</div>

Oso also recognizes common shell commands (`rm`, `chmod`, `mv`, `tar`, and similar) as a built-in **System** integration, for CLI activity that isn't tied to one of the integrations above.

More integrations are being added regularly, and we're building the ability to automatically identify integrations Oso hasn't cataloged yet - not just the ones listed here. If you need support for a specific one now, reach out.

## Example policies

### Require security approval for GitHub writes and deletions

<Steps>
  <Step title="Name your policy">
    ```yaml theme={null}
    Name: Require security approval for GitHub writes and deletes
    ```
  </Step>

  <Step title="Set conditions">
    ```yaml theme={null}
    Operation:
      Type: Write, Destructive
    Resource:
      Provider: GitHub
    ```
  </Step>

  <Step title="Configure response">
    ```yaml theme={null}
    Enforce: Require security approval ("Blocked pending security review")
    ```
  </Step>
</Steps>

***

### Require user approval before deleting a Linear issue

<Steps>
  <Step title="Name your policy">
    ```yaml theme={null}
    Name: User approval for Linear deletions
    ```
  </Step>

  <Step title="Set conditions">
    ```yaml theme={null}
    Operation:
      Tools: Delete issue
    ```
  </Step>

  <Step title="Configure response">
    ```yaml theme={null}
    Enforce: Require user approval ("This needs your OK before it runs")
    ```
  </Step>
</Steps>

***

### Alert when Cursor makes any destructive call

<Steps>
  <Step title="Name your policy">
    ```yaml theme={null}
    Name: Alert on Cursor destructive calls
    ```
  </Step>

  <Step title="Set conditions">
    ```yaml theme={null}
    Actor:
      Agent name: Cursor
    Operation:
      Type: Destructive
    ```
  </Step>

  <Step title="Configure response">
    ```yaml theme={null}
    Alert: Medium severity, every time
    ```
  </Step>
</Steps>

***

### Alert when an unsanctioned agent is discovered

<Steps>
  <Step title="Name your policy">
    ```yaml theme={null}
    Name: Alert on disallowed agent discovery
    ```
  </Step>

  <Step title="Set conditions">
    ```yaml theme={null}
    Actor:
      Agent review status: Disallowed
    ```
  </Step>

  <Step title="Configure response">
    ```yaml theme={null}
    Alert: Medium severity, every time
    ```
  </Step>
</Steps>

***

### Block and alert on a custom regex match

<Steps>
  <Step title="Name your policy">
    ```yaml theme={null}
    Name: Block serious prod regex
    ```
  </Step>

  <Step title="Set conditions">
    ```yaml theme={null}
    Actor:
      Agent name: Cursor
    Resource:
      Content type: Serious prod regex
    ```
  </Step>

  <Step title="Configure response">
    ```yaml theme={null}
    Alert: Medium severity, once every 30 minutes
    Enforce: Block ("Can't use this regex")
    ```
  </Step>
</Steps>

Since this policy has no tool-scoping condition, it runs on every point in the session - user prompts, tool requests, and tool responses. It alerts your team at most once every 30 minutes, and blocks any match - redacting the response if the match is only found there.

***

### Block API key leaks in any session

<Steps>
  <Step title="Name your policy">
    ```yaml theme={null}
    Name: Block API key leaks
    ```
  </Step>

  <Step title="Set conditions">
    ```yaml theme={null}
    Resource:
      Content type: API keys
    ```
  </Step>

  <Step title="Configure response">
    ```yaml theme={null}
    Enforce: Block
    ```
  </Step>
</Steps>

## Get help

Reach out if you need support for an integration or condition type not covered here.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.