# The hybrid model

> How Deer lets people, AI, MCP clients and automations do the same work through one action, one permission check and one audit record.

Source: https://docs.deerapp.co/en/developers/hybrid_model/

## One action for every actor

Everything that changes data in Deer is an **action**: create a task, send a message, revoke an MCP connection. An action is defined once, and every surface uses that definition:

- the interface, when a person selects a button or submits a form,
- AI, when it proposes a tool call in a conversation,
- MCP clients, through the tools on the workspace MCP server,
- automations, when they run a step.

Because there is one definition, a person and an agent fill in the same fields, pass the same permission check and leave the same kind of audit record. A capability cannot exist for people and be missing for AI, or the other way round. Nothing writes to a workspace around an action.

## Anatomy of an action

| Part | Example | Purpose |
| --- | --- | --- |
| `id` | `tasks.create` | A stable name, `module.verb`. It is also the MCP tool name. |
| `module` | `tasks` | The module that owns it. |
| `title`, `description` | Create task | Shown to people in Arabic and English, and to models choosing a tool. |
| `scope` | `tasks:write` | The permission it requires. |
| `risk` | `write` | How dangerous it is: decides confirmation and approval. |
| Input schema | `title`, `due`, `assignees` | A strict schema. Unknown fields are rejected. |

The server validates every input against the schema before anything runs. A result always has `ok`, a bilingual `message` and, when a record was created or changed, a link to it.

## Actors

Every run has an **actor**. Non-human actors always act on behalf of a person and never hold more permission than that person.

| Actor | Who it is | Acts for | Permission it gets | Where approvals happen |
| --- | --- | --- | --- | --- |
| `user` | A signed-in person. | Themselves. | Their role and overrides. | No approval. Destructive actions ask them to confirm. |
| `ai` | AI or an AI agent in a conversation. | The person who asked. | That person's permission, limited further by the conversation's audience. | In the conversation, by the person who asked. |
| `mcp` | An external client using an MCP connection. | The person who created the connection. | That person's permission, limited to the connection's task scope. | In **Settings**, **MCP**, by the connection owner. |
| `automation` | A workflow step or a scheduled job. | The automation's owner. | The owner's permission, limited to the automation's grants. | Workflows (Soon). |
| `system` | Deer itself, for maintenance. | Nobody. | Server-defined. | Not applicable. |

Workflow automations are not available in the cloud beta yet (Soon). See the [roadmap](https://deerapp.co/en/roadmap/). Today, Deer's own scheduled jobs, such as delivering a reminder when it is due, are recorded as automation.

Records created or changed by AI or MCP carry the actor's mark in the interface, so people can always tell what was not done by a person.

## Permissions

A permission is a **scope**: a module and an access level, written `module:access`. The levels are ordered `read` < `write` < `admin`, and a higher level includes the lower ones. `tasks:write` allows everything `tasks:read` allows.

Each role has default access per module:

| Role | Default access |
| --- | --- |
| Owner | `admin` on every module. Cannot be restricted. |
| Admin | `admin` on every module except the audit log, which is `read`. |
| Member | `write` on most modules. `read` on Settings and People. No access to MCP or the audit log. |
| Guest | `read` on Tasks, Chat, Files and profiles. Nothing else. |

Owners and admins can override access for a role or for one person, per module, in the workspace permissions. See [Roles and permissions](https://docs.deerapp.co/en/admin/roles_and_permissions/).

For a non-human actor, the effective permission is the **intersection**:

1. The person it acts for must hold the action's scope.
2. The actor must also have been granted that scope.

An MCP connection with `tasks:write`, owned by an admin whose task access was lowered to `read`, can only read. Checks run again on every call, so a change of role takes effect on the next request.

## Risk

| Risk | Meaning | A person | AI, MCP, automation |
| --- | --- | --- | --- |
| `read` | Changes nothing. | Runs. | Runs. |
| `write` | Creates or edits inside the workspace. Reversible. | Runs. | Runs. A workspace can require approval for AI writes. |
| `destructive` | Deletes, or cannot be undone. | Confirms first. | **Stops for a person's approval.** |
| `external` | Leaves the workspace: sends email, calls an app, schedules with a provider. | Runs, and the form warns. | **Stops for a person's approval.** |

The approval rule for `destructive` and `external` cannot be loosened. AI also asks for approval before administrative actions and before changes to channel, team or file access. See [Approvals](https://docs.deerapp.co/en/ai/approvals/).

## Approvals

An approval is bound to the exact request: the action, its arguments and the current version of the record it targets. If the record changes before the action runs, the approval no longer applies and the request must be made again. This stops an approved request from acting on something the approver never saw.

- **AI** shows the proposed action in the conversation. The person who asked approves or rejects it there.
- **MCP** returns `MCP_APPROVAL_REQUIRED` with an approval id. The connection owner decides in Settings, and the client retries with the id. See [MCP tools](https://docs.deerapp.co/en/connect/mcp_tools/#approval-flow).

The AI requester or MCP connection owner can review their pending requests in **Actions**, under **Approvals**.

## Audit events

Every attempt to run an action writes an audit event, including attempts that are refused:

| Status | When |
| --- | --- |
| `success` | The action ran. |
| `denied` | The actor lacked permission, or the module is disabled. |
| `failed` | The action started but could not complete. |
| `pending-approval` | The action stopped to wait for a person. |
| `rejected` | A person rejected a request from AI. |

Each event records the action id, the person, the actor kind and, for AI and MCP, which agent or connection acted. Owners and admins read these in the [audit log](https://docs.deerapp.co/en/admin/audit_log/).

## Idempotency

The Deer interface sends a unique key with every write. If the same key arrives again with the same input, for example after a network retry, Deer returns the stored result instead of running the action twice. The same key with different input is refused with `IDEMPOTENCY_CONFLICT`.

MCP write tools that run without approval accept an optional key to deduplicate calls from the same connection for 24 hours. Deletion uses a single-use approval ID. See [Retry a write](https://docs.deerapp.co/en/connect/mcp_tools/#retry-writes).

Work that leaves Deer, such as sending mail or running an app tool, is never retried automatically when its outcome is uncertain. It is flagged for a person to check.

## Where actions run today

| Surface | What it can run in the cloud beta |
| --- | --- |
| Interface | Every action in the [actions reference](https://docs.deerapp.co/en/developers/actions_reference/) that your role allows. |
| AI | Native Deer actions in the conversation, under your permission and approvals. Mail, connected apps and provider calendars are excluded. |
| MCP | Eight task tools. See [MCP tools](https://docs.deerapp.co/en/connect/mcp_tools/). |
| Automations | Workflows (Soon). |
| Public endpoint | One action: `settings.join_waitlist`. See [API](https://docs.deerapp.co/en/developers/api/). |

- [Actions reference](https://docs.deerapp.co/en/developers/actions_reference/) Every action id, its risk and who may run it.
- [Errors and approvals](https://docs.deerapp.co/en/developers/errors_and_approvals/) What a client sees and how to retry.
- [MCP](https://docs.deerapp.co/en/connect/mcp/) Connect an external client.
