Devin AI System Prompt Architecture: Playbooks, Rules, and Subagent Profiles
A Devin AI system prompt is the foundational instruction set that governs Devin's reasoning loop, assembled hierarchically from Cognition's core system prompt, AGENTS.md rules, skill agent profiles, and Playbooks. Understanding how these layers interact allows engineering teams to control agent behavior, restrict tool permissions, and reduce compute costs. By backing these configurations with Fast.io workspaces, teams maintain persistent, auditable prompt libraries across sessions.
How Devin Assembles Context Across Four System Prompt Layers
Point an autonomous coding agent at a multi-repository codebase with only a high-level prompt, and the agent frequently stalls on architectural decisions, selects incompatible package managers, or runs expensive model inferences for routine directory scans. The root cause is not model deficiency; it is treating the system prompt as a single static instruction rather than an architectural stack.
A Devin AI system prompt is the foundational instruction set that governs Devin's reasoning loop, assembled hierarchically from Cognition's core system prompt, AGENTS.md rules, skill agent profiles, and Playbooks.
Unlike conversational chat assistants that accept a single monolithic instruction block, Cognition designed Devin around a multi-tier runtime architecture. Each level in the hierarchy injects specific operational constraints into Devin's context window. This separation ensures that global safety mechanisms remain intact while engineering teams enforce repository-level conventions and workflow routines without rewriting the core operating instructions on every prompt.
The Hierarchical Prompt Architecture
Devin constructs its active context by layering four distinct operational tiers:
Base Runtime System Prompt: Authored and maintained by Cognition. Governs Devin's core agent loop, tool calling protocols, shell command parsing, sandboxed Ubuntu execution environment, browser interaction, and failure recovery cycles.
Persistent Repository Rules: Defined by engineering teams in
AGENTS.md,AGENTS.local.md, or modular rule files under.devin/rules/. Enforces codebase conventions, linting commands, language preferences, and tool restrictions across all sessions in a repository.Subagent Profiles: Defined under
.devin/agents/. Establishes role-specific system prompts, allowed tools, and model routing for child agents spawned during complex parallel work.Playbooks and Task Directives: Reusable procedural blueprints (
.devin.mdfiles or web app playbooks) and runtime user prompts. Dictates step-by-step procedures, acceptance criteria, and specific business logic for individual engineering jobs.
Runtime Context Assembly and Token Budgeting
Devin combines these layers at session initialization. The base prompt initializes the reasoning container, after which repository rules establish project constraints. When a user invokes a playbook or initiates a specific job, those instructions bind to the active conversation thread.
Cognition explicitly advises keeping rules and AGENTS.md files as compact as possible. When teams place hundreds of lines of documentation or style guides directly into persistent rules, the model experiences attention dilution. Long prompt contexts increase token consumption on every reasoning step and make it easier for an agent to miss critical constraints. Offloading detailed technical references to on-demand skills or targeted playbooks ensures the primary prompt stack remains focused on essential guardrails.
Configuring Persistent Repository Guidelines with AGENTS.md and Rules
Devin CLI and web workspaces discover configuration files across multiple project layers. This structure lets developers set global defaults while allowing repositories and subdirectories to declare specific overrides.
Devin resolves persistent instructions using a defined discovery sequence:
- Global Rules: Located at
~/.config/devin/AGENTS.mdon Linux and macOS, or%APPDATA%\devin\AGENTS.mdon Windows. Injected into every session across all projects on a developer's workstation. - Project Rules: Stored in
AGENTS.mdorAGENT.mdat the project root. Version-controlled in Git, ensuring that every developer and CI run shares identical operational standards. - Personal Local Rules: Stored in
AGENTS.local.mdalongsideAGENTS.mdand added to.gitignore. Used for personal workflow preferences, local environment paths, or testing styles without altering shared team configuration. - Subdirectory Discovery: Devin CLI discovers rules in subdirectories lazily as files in those directories are opened. In a monorepo with multiple microservices, placing an
AGENTS.mdinsideservices/billing/ensures billing-specific conventions activate only when Devin touches billing code, avoiding context pollution. - Cross-Tool Compatibility: Devin CLI reads rules from
.cursor/rules/*.mdc,.windsurf/rules/*.md, and.claude/CLAUDE.md, allowing teams to preserve existing rule configurations.
Detailed configuration options are documented in the Devin Rules Documentation.
Rule Activation Modes and Frontmatter Triggers
Modular rule files stored in .devin/rules/*.md support YAML frontmatter to control when instructions enter context:
Here is an example of a glob-activated rule stored at .devin/rules/api-standards.md:
---
description: "API design and error response standards"
globs: "src/controllers/**/*.ts"
---
All API endpoints must return JSON responses matching the standard envelope:
- Success responses must wrap data in a `data` object.
- Error responses must return an `error` object containing `code`, `message`, and `details`.
- Never return raw database model instances directly to the client.
Structuring Effective Project Rules
Project rules should focus on operational guardrails rather than generic programming advice. Effective rules share several characteristics:
- Imperative Directives: State exact commands rather than suggestions. Use "Run pnpm test before committing" instead of "Make sure tests pass".
- Concrete File Paths: Point to reference files and configuration paths directly so the agent can inspect existing patterns.
- Negative Constraints: Explicitly state actions the agent should avoid, such as modifying lockfiles without approval or introducing new third-party dependencies.
How to Configure Subagent Profiles for Tool and Cost Control
Complex engineering objectives benefit from dividing work across multiple focused agents. Devin supports subagents: independent workers spawned by the parent agent to research code, run test suites, or implement components in parallel.
A subagent shares tools and codebase context with the parent, but operates in its own conversation chain and does not inherit the parent's conversation history. This isolation keeps the primary reasoning thread clean and prevents context window exhaustion during deep codebase explorations.
Agent profiles can constrain models, tool permissions, and operational guidelines per subagent. By configuring specialized profiles, engineering teams ensure that exploratory routines do not consume expensive model credits and that subagents cannot run destructive commands. Detailed profile specifications are covered in the Devin Subagents Documentation.
Built-In and Custom Subagent Profiles
Devin provides two built-in profiles, alongside support for custom profiles defined in .devin/agents/:
subagent_explore: Built-in profile for read-only codebase research. Uses the default subagent model, which resolves to SWE-1.6 by default. It is restricted to read-only tools:read,grep,glob, and web search. It cannot edit files or make arbitrary network requests.subagent_general: Built-in general-purpose profile. Inherits the parent agent's selected model, such as Claude Opus or GPT-5. Has access to the full toolset, including file modifications and shell execution.- Custom Subagents: Defined in
.devin/agents/<name>.mdor.devin/agents/<name>/AGENT.md. Allows teams to specify custom system prompts, pin dedicated models, and restrict allowed tools.
Defining Custom Subagent Profiles
Custom subagents use YAML frontmatter followed by a markdown system prompt. Teams can pin a fast model and restrict tool access to prevent accidental regressions.
Here is a custom code review subagent defined at .devin/agents/reviewer.md:
---
name: reviewer
description: Reviews pull requests for security and test coverage
model: sonnet
allowed-tools:
- read
- grep
- glob
- exec
max-nesting: 1
---
You are a dedicated code review subagent. Your job is to inspect proposed changes before a pull request is finalized.
Review checklist:
1. Verify that all new endpoints have corresponding integration tests.
2. Check for SQL injection vulnerabilities and unescaped input parameters.
3. Confirm that no secrets or API keys exist in code or comments.
4. Run `npm test` using the exec tool and report all failures with file paths and line numbers.
Execution Modes and Cost Control
Subagents run in two operational modes:
- Foreground: Runs inline within the active session. The parent agent pauses while the subagent works. The user reviews and approves tool calls as they occur.
- Background: Runs concurrently in parallel. The parent agent continues working on other jobs. The subagent inherits pre-approved tool permissions; any unapproved tool is denied automatically.
Subagent compute costs scale with each worker spawned. By default, subagents cannot spawn child subagents. Setting the max-nesting field in custom profile frontmatter allows controlled multi-level delegation for large refactors while capping recursion depth to prevent runaway spend.
Manage Devin Prompt Libraries in One Shared Workspace
Store versioned Playbooks, AGENTS.md templates, and subagent profiles in persistent Fast.io workspaces with native MCP access. Every organization starts with a 14-day free trial, which requires a credit card.
Why Engineering Teams Standardize Workflows with Devin Playbooks
While AGENTS.md sets continuous repository guidelines, engineering teams frequently execute multi-step procedures that require a specific sequence of actions. Playbooks act as standardized custom system prompts across recurring engineering workflows. Instead of manually explaining steps, target directories, and testing constraints each time a developer launches an agent session, teams codify these requirements into reusable blueprints.
A playbook provides a shareable, version-controlled blueprint for complex operations, such as migrating a database schema, onboarding a microservice, or upgrading dependencies across services. When multiple engineers use Devin for similar refactoring projects, playbooks ensure every session executes against identical verification standards. Codifying these practices eliminates discrepancies between developer prompts and establishes reliable automation patterns across the organization.
Playbooks differ from Devin's Knowledge base. Knowledge stores persistent factual context, coding conventions, and architectural background that Devin recalls semantically across sessions. Playbooks define multi-step imperative procedures executed from start to finish. Teams can explore prompt construction guidelines in the Devin Effective Instructions Guide.
Core Structure of a Devin Playbook
Effective playbooks contain five structured components:
- Overview: Brief explanation of the operational objective and scope.
- What Is Needed From User: Explicit inputs required upfront, such as target endpoints, database names, or API credentials.
- Procedure: Step-by-step imperative actions, written with one step per line. Steps should be mutually exclusive and collectively exhaustive.
- Specifications: Concrete postconditions and verification criteria that must pass before Devin marks the task complete.
- Advice and Forbidden Actions: Guidance that overrides default model tendencies, paired with hard guardrails preventing destructive commands.
Production Playbook Example: Database Schema Migration
Below is a complete playbook saved as database-migration.devin.md. Teams can trigger this playbook using a macro or attach it directly to a Devin session:
Playbook: Safe Database Schema Migration
## Overview
Execute an incremental schema migration for PostgreSQL services using Prisma.
## What Is Needed From User
- Name of the target migration
- Target database environment (development or staging)
## Procedure
1. Inspect the Prisma schema file at `prisma/schema.prisma` for uncommitted changes.
2. Generate a draft migration file using `npx prisma migrate dev --create-only --name <migration-name>`.
3. Inspect the generated SQL script in `prisma/migrations/` to verify table indices and column types.
4. Run existing database unit tests using `npm run test:db`.
5. Apply the migration to the local test database using `npx prisma migrate deploy`.
6. Execute the verification test suite to ensure existing queries remain functional.
## Specifications
-
The migration must complete with zero schema validation errors.
- All database unit tests in `test/database/` must pass.
- No existing tables or columns may be dropped without explicit user approval.
## Advice and Forbidden Actions
- Never run `prisma migrate reset` or any command that deletes existing database data.
- If a foreign key constraint fails during migration, halt execution and report the constraint conflict.
Playbook Macros and Enterprise Distribution
Teams can assign short macros starting with ! (such as !db-migrate or !security-check) to playbooks. Typing the macro into the Devin prompt input attaches the playbook instantly.
Playbooks maintain full version history within Devin, allowing teams to audit changes and revert modifications when workflows evolve. In enterprise organizations, administrators can publish playbooks globally across all workspaces to maintain consistent engineering practices across distributed teams.
How Teams Connect Devin to Fast.io for Shared Prompt Libraries
As organizations scale their use of Devin, maintaining prompts across individual developer machines creates operational friction. Teams face scattered AGENTS.md files, diverging subagent configurations, and disconnected playbook versions.
Traditional storage approaches fail to address the needs of agentic teams:
- Local Repositories: Rule files remain siloed on developer laptops or require frequent Git commits for minor prompt tweaks.
- General Cloud Storage: Services like Google Drive, Dropbox, and Box were designed for human file sharing. They lack agent-native protocols, cannot expose structured metadata directly to agents, and introduce rate limits when agents read and write files programmatically.
- Intelligent Agent Workspaces: Dedicated workspaces provide persistent storage, native agent interfaces, version control, and real-time co-editing for both developers and autonomous agents.
Fast.io serves as the collaborative workspace layer where teams store, version, and share their Devin prompt libraries, architecture documents, and execution artifacts.
Connecting Devin to Fast.io via the Model Context Protocol
Developers connect Devin to Fast.io workspaces using the remote Model Context Protocol (MCP) server. Teams configure Fast.io Agent Storage over Streamable HTTP at https://mcp.fast.io/mcp (or https://mcp.fast.io/mcp/key with Bearer authentication), alongside a legacy SSE transport at https://mcp.fast.io/sse. Complete server specifications are detailed in the Fast.io Agent Storage guide and the Model Context Protocol specification at https://mcp.fast.io/skill.md, alongside onboarding notes at https://fast.io/llms.txt.
Developers configure Fast.io in their Devin environment settings:
{
"mcpServers": {
"fastio": {
"url": "https://mcp.fast.io/mcp/key",
"headers": {
"Authorization": "Bearer YOUR_FASTIO_API_KEY"
}
}
}
}
Through this connection, Devin queries prompt templates, reads architecture specifications using hybrid search (combining exact full-text and semantic retrieval), and writes execution reports directly to persistent workspaces.
Structuring Prompt Assets in Fast.io Workspaces
An engineering organization can structure a dedicated Fast.io workspace to govern its agent configurations:
/prompt-library/playbooks/: Houses standardized.devin.mdworkflows for migrations, releases, and refactoring./prompt-library/agents/: Stores shared subagent profile definitions (reviewer.md,researcher.md)./architecture-specs/: Contains system design documents and API schemas, automatically indexed for semantic search once Intelligence is enabled./execution-logs/: Receives build summaries, test outputs, and audit reports written by Devin sessions.
Every file in a Fast.io workspace maintains per-file version history, so developers can inspect edits and roll back prompt changes without Git merge conflicts. Fast.io Notes provide real-time co-editing where developers and agents collaborate on playbooks with live multiplayer cursors.
When Devin generates test reports or deployment summaries, teams can use Metadata Views to extract structured data automatically. Developers describe desired fields in plain English, and the system populates a typed data grid with fields such as test status, execution duration, and error codes.
Every organization starts with a 14-day free trial, which requires a credit card. Teams can review subscription tiers on the Fast.io pricing page:
Frequently Asked Questions
What is Devin AI's system prompt?
A Devin AI system prompt is the foundational instruction set that governs Devin's reasoning loop, assembled hierarchically from Cognition's core system prompt, AGENTS.md rules, skill agent profiles, and Playbooks. It combines base sandbox execution guidelines with repository conventions and task-specific workflows.
How do you customize instructions for Devin AI?
You customize instructions for Devin AI through multiple layers. For persistent codebase standards, add an AGENTS.md file to your project root or ~/.config/devin/AGENTS.md for global rules. For specialized subtasks, configure custom subagent profiles in .devin/agents/. For repeatable multi-step workflows, create Playbooks with clear procedures and postconditions.
How do AGENTS.md and playbooks affect Devin's system prompt?
AGENTS.md supplies persistent rules injected at the start of every session to enforce coding standards, package manager preferences, and testing commands. Playbooks act as task-level system prompts that define step-by-step procedures, specifications, and guardrails for specific recurring engineering tasks.
What is the difference between Devin Playbooks and Knowledge?
Playbooks define procedural, step-by-step instructions for completing specific tasks such as migrations or refactoring. Knowledge stores persistent factual context, architecture conventions, and coding patterns that Devin retrieves semantically across sessions when relevant.
How does subagent profile configuration help reduce inference costs?
Subagent profiles allow teams to route specific tasks to cheaper models and restrict tool capabilities. For example, the built-in subagent_explore profile uses the default subagent model (SWE-1.6) with read-only tools, preventing expensive frontier model spend during routine codebase research.
Related Resources
Manage Devin Prompt Libraries in One Shared Workspace
Store versioned Playbooks, AGENTS.md templates, and subagent profiles in persistent Fast.io workspaces with native MCP access. Every organization starts with a 14-day free trial, which requires a credit card.