Skip to content
ThirdLayer

Docs > Agents

Working with agents

Configure Dex agent instructions, execution harnesses, models, required apps, and approval settings so interactive and background runs stay reliable.

Whether you work with Dex interactively in chat or through a saved AGENT.md in Factory, reliable results come from clear boundaries: what sources to check first, what output format to produce, and which external writes require human review.

A saved agent is defined by AGENT.md in your personal directory (users/<you>/agents/<slug>/AGENT.md) or in the shared workspace (workspace/agents/<id>/AGENT.md):

agents/deal-hygiene/AGENT.md
---
schemaVersion: 1
title: Deal hygiene
harness: dex
model: inherit
requireWriteApproval: true
requires:
- slack
- gmail
- attio:
- update_record
---
Check open opportunities against recent Slack threads and Gmail conversations.
Compare each deal's stage, next step, and close date against actual customer
messages from the past 7 days.
Never invent dates or commitments. Cite the Slack permalink or email thread
behind every proposed CRM update.
FieldDefaultPurpose
titleFolder slugHuman-readable display name shown in the UI and CLI
harnessdexExecution runtime: dex, claude, or codex
modelinheritModel identifier, or inherit to use the harness default
requireWriteApprovaltrueRoutes external integration writes to durable Pending Action cards
autoModeOmittedOptional automated write reviewer (true or a plain-language policy). Requires requireWriteApproval: true
requiresOmittedApps—and optionally specific tools (app: [tool_a, tool_b])—required before a run can execute
modeOmittedSet to shared for workspace-owned shared agents
pendingActionVisibilityadminsShared agents only: admins lets agent admins review member cards; self restricts cards to each member

Never restate title, harness, model, requireWriteApproval, or autoMode inside child automations/*.md files—automations always inherit those settings from AGENT.md.

Every interactive turn and automation run executes through a durable session runtime that supports three selectable harnesses:

HarnessExecution modelBest forNotes
dex (default)Native multi-agent loop (orchestrator + delegate_subagent) with deferred tool loadingDay-to-day interactive chat, browser extension sessions, and general automationsSupports incognito sessions and client-side browser/desktop tools in interactive chat
claudeSandboxed Claude harness running in an E2B sandboxFile-heavy authoring, multi-step Factory/Zeta CLI work, and long-running analysisPersisted durable sessions with direct /workspace/factory checkout and dex CLI access
codexSandboxed Codex harness running in an E2B sandboxStructured scripting, workflow execution, and multi-file editsPersisted durable sessions with /workspace/factory checkout and durable recovery

Leave model: inherit unless you have a specific reason to pin a model; inheriting keeps agents aligned with your workspace’s default harness configuration.

Declaring app and tool requirements (requires)

Section titled “Declaring app and tool requirements (requires)”

Use requires to declare what an agent cannot run without:

  • List app names using their canonical catalog identifiers (for example, slack, gmail, attio, linear, notion). Run dex scopes catalog to see exact names.
  • Name individual tools only when a run truly fails without them (attio: [update_record]).
  • requires is a readiness check, not a permission grant. If a user has not connected a required app—or excluded it from their Access Scope—Dex flags the agent as needing setup and skips scheduled runs with an explicit reason instead of failing halfway through.

Background automation runs start fresh without prior chat history. Follow four rules when writing AGENT.md and task prompts:

  1. Name the sources and priority order. Tell the agent when to check the knowledge graph (dex zeta) first versus calling live Slack/Gmail tools.
  2. Keep personal details out of shared instructions. For shared agents, never hard-code your own accounts, channel IDs, or territories in AGENT.md; collect per-member specifics during TEAM.md setup and store them in team/.
  3. Separate standing rules from per-run tasks. Put persona, evidence rules, and safety limits in AGENT.md, and put the specific run window or deliverable in automations/<name>.md.
  4. Move repeatable procedures into skills. If a checklist grows past a few paragraphs—or applies to more than one agent—extract it into a skill. Agent-scoped skills under agents/<slug>/skills/<skill>/SKILL.md are visible only to that agent and override skills of the same name during its runs.