# Agents

## Overview

Agents are chat-based assistants that execute complex tasks.

{% hint style="success" %}
Rather than navigating menus or configuring settings, users describe their needs in the chat interface, and the appropriate agent takes action.
{% endhint %}

Each agent is powered by a specialized LLM trained on Salesforce development patterns, best practices, and platform-specific constraints.

## How Agents work

### Activation

Agents are invoked through the chat interface based on intent.

{% hint style="success" %}
There are no special commands or syntax. Describe what you need, and SRE.ai routes to the appropriate agent.
{% endhint %}

**Examples:**

* "I need to implement a regression test class for the Case Type picklist" → Design Agent
* "Let's build this" (after a design is approved) → Build Agent
* "Deploy these changes to staging" → Deploy Agent

### Visibility

Agents surface every action they take.

When an agent executes, users see:

* **Thought process:** The agent's reasoning as it plans the work
* **Plan:** A structured list of steps the agent will execute
* **Step-by-step progress:** Each action logged with timestamps
* **Artifacts:** Design documents, code files, PRs, and other outputs

Users can expand any step to see details, including commands run, files read, and web searches performed.

### Human-in-the-loop

Agents pause at key decision points for user input:

* Design documents require approval before building begins
* Generated code is presented for review before committing
* Deployments surface what will change before executing

This ensures users maintain control over what gets created and deployed.

### Execution environment

Each agent task runs in an isolated, ephemeral container. Containers are pre-warmed, so agents start in under a second.

Every task gets a clean environment.

There is no state carried over from previous runs. This makes agent results reproducible and prevents unintended side effects between tasks.

Operations have defined time limits:

| Operation                  | Timeout    |
| -------------------------- | ---------- |
| Generate code (Apex, etc.) | 5 minutes  |
| Run code                   | 5 minutes  |
| Commit change              | 10 minutes |
| Review change              | 10 minutes |
| Retrieve metadata          | 30 minutes |
| Deploy metadata            | 2 hours    |

If an operation exceeds its limit, the task will fail with a timeout error.

For complex deployments or large metadata retrievals, this is the expected constraint to be aware of.

### Integration with Changes

Agent work ties back to SRE.ai's Changes feature.

When an agent begins work, it creates or links to a Change artifact that tracks the full lifecycle, from design through deployment. This provides a single view of everything associated with a feature or fix.

Agents can also link to external issue trackers. If a Jira ticket is referenced, the agent associates its work with that issue. However, linked tickets are not required. Users can simply describe their requirements.

## Agent summaries

### Design agent

The Design Agent creates technical design documents for Salesforce development work.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><p><strong>What it does</strong></p><p>Given a problem statement or feature request, the Design Agent:</p><ul><li>Explores your repository structure and existing patterns</li><li>Examines relevant Salesforce metadata (objects, fields, picklists, etc.)</li><li>Research best practices and validation requirements</li><li>Designs a solution architecture</li><li>Produces a comprehensive technical design document</li></ul></td><td></td></tr><tr><td><p><strong>Output</strong></p><p>The Design Agent generates a design document that includes:</p><ul><li><strong>Success criteria:</strong> What the implementation must achieve</li><li><strong>Architecture:</strong> Component overview and relationships</li><li><strong>Design decisions:</strong> Rationale for the chosen approach</li><li><strong>Implementation plan:</strong> Steps to build the solution</li><li><strong>Testing strategy:</strong> How the solution will be validated</li><li><strong>Risks:</strong> Potential issues and mitigations</li></ul><p>Design documents are stored in the Change artifact. Each document has a status that tracks where it is in the review process:</p><p>You can change the status at any time using the status selector in the document header. The document content is editable and saves automatically.</p></td><td></td></tr><tr><td><p><strong>Example</strong></p><p><strong>User:</strong> "Implement a regression test class for the value in Type picklist"</p><p><strong>Design Agent actions:</strong></p><ol><li>Confirms the issue and creates a Change</li><li>Explores repository structure and patterns</li><li>Examines the Case object and the Type picklist metadata</li><li>Research picklist validation best practices</li><li>Designs the test architecture</li><li>Creates a comprehensive technical design document</li><li>Submits design for approval</li></ol><p><strong>Output:</strong> A design document specifying that the solution will use Salesforce's Schema API to dynamically retrieve and validate picklist metadata, with success criteria including 100% code coverage and immediate failure when required values are missing.</p></td><td></td></tr><tr><td><p><strong>Steps</strong></p><ol><li>Describe the problem or feature in the chat interface</li><li>The Design Agent confirms the issue and creates a linked Change</li><li>Review the agent's plan via "View Plan"</li><li>Monitor progress as the agent researches and designs</li><li>Review the generated design document</li><li>Approve the design to proceed to building, or request revisions</li></ol></td><td></td></tr></tbody></table>

### Build agent

The Build Agent implements solutions based on approved designs or direct instructions.

<table data-card-size="large" data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><p><strong>What it does</strong></p><p>Given an approved design or a build request, the Build Agent:</p><ul><li>Initializes the repository context</li><li>Creates a feature branch from main</li><li>Generates code files following your repository's patterns</li><li>Creates associated metadata files</li><li>Deploys and validates in a target instance</li><li>Commits and pushes changes</li></ul></td></tr><tr><td><p><strong>Output</strong></p><p>The Build Agent produces:</p><ul><li><strong>Feature branch:</strong> A new branch for the implementation</li><li><strong>Code files:</strong> Apex classes, Lightning components, or other artifacts</li><li><strong>Metadata files:</strong> Associated .meta.xml files configured correctly</li><li><strong>Validation results:</strong> Confirmation that code deploys and tests pass</li><li><strong>Committed changes:</strong> Code pushed to the feature branch</li></ul><p>All generated code follows existing repository patterns. The agent examines your codebase to match naming conventions, file organization, and coding style.</p></td></tr><tr><td><p><strong>Example</strong></p><p><strong>User:</strong> "Let's build this" (after approving a design for a regression test class)</p><p><strong>Build Agent actions:</strong></p><ol><li>Confirms target instance (e.g., poolorg01)</li><li>Implements solution per the design document</li><li>Creates feature branch (e.g., feature/d9c96ea9) from main</li><li>Creates CaseTypePicklistTest.cls file</li><li>Creates CaseTypePicklistTest.cls-meta.xml file</li><li>Deploys and validates test class</li><li>Commits and pushes changes</li></ol><p><strong>Output:</strong> A complete, validated implementation on a feature branch ready for review.</p></td></tr><tr><td><p><strong>Steps</strong></p><ol><li>Approve a design document, or describe what you want built directly</li><li>The Build Agent confirms the target instance</li><li>Review the agent's plan via "View Plan"</li><li>Monitor progress as the agent creates and validates code</li><li>Review the generated files and validation results</li><li>Proceed to PR creation or request changes</li></ol></td></tr></tbody></table>

### Deploy agent

The Deploy Agent handles AI-driven deployments to target environments.

<table data-card-size="large" data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><p><strong>What it does</strong></p><p>Given a deployment request, the Deploy Agent:</p><ul><li>Identifies what needs to be deployed</li><li>Confirms the target environment</li><li>Executes the deployment with appropriate validations</li><li>Reports results and surfaces any issues</li></ul></td></tr><tr><td><p><strong>Output</strong></p><p>The Deploy Agent produces:</p><ul><li><strong>Deployment confirmation:</strong> What was deployed and where</li><li><strong>Validation results:</strong> Test execution and quality gate status</li><li><strong>Error reporting:</strong> Clear surfacing of any failures with context</li></ul></td></tr><tr><td><p><strong>Example</strong></p><p><strong>User:</strong> "Deploy these changes to staging"</p><p><strong>Deploy Agent actions:</strong></p><ol><li>Identifies the changes to deploy</li><li>Confirms staging as the target environment</li><li>Executes deployment</li><li>Runs associated validations</li><li>Reports success or surfaces issues</li></ol><p><strong>Output:</strong> Deployed changes with validation results, logged in the Change timeline.</p></td></tr><tr><td><p><strong>Steps</strong></p><ol><li>Describe what you want deployed and where</li><li>The Deploy Agent confirms the target and scope</li><li>Review the deployment plan</li><li>Monitor progress as the agent deploys and validates</li><li>Review results in the Command Center</li></ol></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sre.ai/using-sre.ai/agents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
