Docs > Factory
Runs, dry runs, and self-improvement
# Runs, dry runs, and self-improvement Reliable agents are built by inspecting real runs, capturing where humans edited or rejected proposed actions, and tightening instructions, skills, or policies in Factory. Dex gives you four tools to close that loop: **run and card inspection**, **transcript export**, **dry runs**, and **Agent Issues with self-improvement**. ```mermaid flowchart TD Run["Automation / Agent Run"] --> Cards["Pending Actions &<br/>Human Feedback"] Run --> Trace["Transcripts, Tool Calls<br/>& Skill Attribution"] Cards --> Improver["Daily Improver<br/>(isolated dry-run sandbox)"] Trace --> Improver Improver --> Issues["Agent Issues<br/>(threads / open / resolved)"] Issues --> Edit["Update AGENT.md, SKILL.md,<br/>or autoMode in Factory"] Edit --> Preview["dex factory preview &<br/>dry-run validation"] Preview --> Run ``` ## Inspecting runs and action feedback Every personal, fan-out, and coordinator run is recorded in `/nexus/automations/runs` and inspectable via the CLI: ```bash # List recent runs for an agent dex agents runs <agent-id> # Inspect a specific run (including nested member runs on a coordinator dispatch) dex runs get <run-id> # Review pending action cards and human rejection/edit feedback dex agents cards <agent-id> --feedback ``` What to look for when tuning an agent: - **Repeated card edits** — If reviewers repeatedly rewrite the same section of a drafted email or CRM field, move that rubric into the agent's `SKILL.md` or `AGENT.md`. - **Repeated rejections with feedback** — Check whether the automation's `condition` is too broad or whether the agent is missing a context source or View. - **Frequent `skipped` member runs** — Inspect unmet `requires` on a shared agent so teammates know which app or Scope permission is missing. - **Skill attribution** — Every `Skill` invocation records structured OpenTelemetry attribution (skill hash, Factory commit SHA, and source reference) so you can verify which version of a skill actually ran. ## Exporting transcripts (JSON and ATIF) You can inspect or export full conversation and run trajectories from the CLI—including Harbor's **ATIF** trajectory format for offline evaluation and analysis: ```bash dex chats list dex chats messages <chat-id> dex chats transcript <chat-id> --format json dex chats transcript <chat-id> --format atif ``` ## Dry runs Never test an unproven edit by triggering a live shared agent across your team—an Admin's `Run now` dispatches to every active member (or starts the live coordinator). Instead, validate changes safely: 1. **Always preview Factory edits first** with `dex factory preview` to check schemas, permissions, and ontology/view impact before pushing. 2. **Use dry-run mode** when validating agent behavior against live context without mutating external systems. Dry runs execute with `dryRun: true`, skip Factory commits, and record synthetic simulated actions instead of writing to external tools. On coordinated shared agents, dry-run mode propagates down to every called member run. 3. **Keep `requireWriteApproval: true`** when rolling out new writes so the first live runs land as reviewable Pending Action cards before you add an `autoMode` policy. ## Agent Issues and self-improvement Dex includes an optional **self-improvement** meta-agent (`agent_improvers`) paired with a structured issue tracker (`agent_issues`, viewed at `/nexus/improve/issues` when enabled for your workspace): - **Daily isolated inspection** — Each enabled agent gets one daily meta-agent that runs in an isolated dry-run sandbox with read-only tools. It inspects the agent's last 60 runs and Pending Action cards (including edits, rejections, and failures). - **Structured evidence-backed issues** — Recurring failure patterns are tracked as deduplicated issues across three states (`thread`, `open`, `resolved`) with confidence scores, frequency counts, and direct links to supporting runs and Pending Actions (`agent_issue_evidence`). - **File-based workflow (`dex issues`)** — Issues sync as Markdown files under `threads/`, `open/`, and `resolved/`: ```bash dex issues pull dex issues push ``` The self-improvement loop surfaces grounded hypotheses and evidence for editors—it never silently rewrites your production `AGENT.md` or `SKILL.md` without review. ## Related pages - [Runs and troubleshooting](/automations/runs-and-troubleshooting/) - Diagnose run statuses and skip reasons - [Tools, scopes, and approvals](/agents/tools-and-approvals/) - Pending Action rejection follow-ups and Auto Mode - [Factory definition as code](/factory/workspace-structure/) - Previewing and publishing improvements safely - [CLI and SDK](/integrations/cli-and-sdk/) - `dex agents`, `dex runs`, `dex chats`, and `dex issues` commandsInspect automation runs, export transcripts, validate changes safely with dry runs, and track recurring failures with Agent Issues and self-improvement.
Reliable agents are built by inspecting real runs, capturing where humans edited or rejected proposed actions, and tightening instructions, skills, or policies in Factory. Dex gives you four tools to close that loop: run and card inspection, transcript export, dry runs, and Agent Issues with self-improvement.
flowchart TD Run["Automation / Agent Run"] --> Cards["Pending Actions &<br/>Human Feedback"] Run --> Trace["Transcripts, Tool Calls<br/>& Skill Attribution"] Cards --> Improver["Daily Improver<br/>(isolated dry-run sandbox)"] Trace --> Improver Improver --> Issues["Agent Issues<br/>(threads / open / resolved)"] Issues --> Edit["Update AGENT.md, SKILL.md,<br/>or autoMode in Factory"] Edit --> Preview["dex factory preview &<br/>dry-run validation"] Preview --> Run
Inspecting runs and action feedback
Section titled “Inspecting runs and action feedback”Every personal, fan-out, and coordinator run is recorded in /nexus/automations/runs and inspectable via the CLI:
# List recent runs for an agentdex agents runs <agent-id>
# Inspect a specific run (including nested member runs on a coordinator dispatch)dex runs get <run-id>
# Review pending action cards and human rejection/edit feedbackdex agents cards <agent-id> --feedbackWhat to look for when tuning an agent:
- Repeated card edits — If reviewers repeatedly rewrite the same section of a drafted email or CRM field, move that rubric into the agent’s
SKILL.mdorAGENT.md. - Repeated rejections with feedback — Check whether the automation’s
conditionis too broad or whether the agent is missing a context source or View. - Frequent
skippedmember runs — Inspect unmetrequireson a shared agent so teammates know which app or Scope permission is missing. - Skill attribution — Every
Skillinvocation records structured OpenTelemetry attribution (skill hash, Factory commit SHA, and source reference) so you can verify which version of a skill actually ran.
Exporting transcripts (JSON and ATIF)
Section titled “Exporting transcripts (JSON and ATIF)”You can inspect or export full conversation and run trajectories from the CLI—including Harbor’s ATIF trajectory format for offline evaluation and analysis:
dex chats listdex chats messages <chat-id>dex chats transcript <chat-id> --format jsondex chats transcript <chat-id> --format atifDry runs
Section titled “Dry runs”Never test an unproven edit by triggering a live shared agent across your team—an Admin’s Run now dispatches to every active member (or starts the live coordinator).
Instead, validate changes safely:
- Always preview Factory edits first with
dex factory previewto check schemas, permissions, and ontology/view impact before pushing. - Use dry-run mode when validating agent behavior against live context without mutating external systems. Dry runs execute with
dryRun: true, skip Factory commits, and record synthetic simulated actions instead of writing to external tools. On coordinated shared agents, dry-run mode propagates down to every called member run. - Keep
requireWriteApproval: truewhen rolling out new writes so the first live runs land as reviewable Pending Action cards before you add anautoModepolicy.
Agent Issues and self-improvement
Section titled “Agent Issues and self-improvement”Dex includes an optional self-improvement meta-agent (agent_improvers) paired with a structured issue tracker (agent_issues, viewed at /nexus/improve/issues when enabled for your workspace):
- Daily isolated inspection — Each enabled agent gets one daily meta-agent that runs in an isolated dry-run sandbox with read-only tools. It inspects the agent’s last 60 runs and Pending Action cards (including edits, rejections, and failures).
- Structured evidence-backed issues — Recurring failure patterns are tracked as deduplicated issues across three states (
thread,open,resolved) with confidence scores, frequency counts, and direct links to supporting runs and Pending Actions (agent_issue_evidence). - File-based workflow (
dex issues) — Issues sync as Markdown files underthreads/,open/, andresolved/:
dex issues pulldex issues pushThe self-improvement loop surfaces grounded hypotheses and evidence for editors—it never silently rewrites your production AGENT.md or SKILL.md without review.
Related pages
Section titled “Related pages”- Runs and troubleshooting - Diagnose run statuses and skip reasons
- Tools, scopes, and approvals - Pending Action rejection follow-ups and Auto Mode
- Factory definition as code - Previewing and publishing improvements safely
- CLI and SDK -
dex agents,dex runs,dex chats, anddex issuescommands