> For the complete documentation index, see [llms.txt](https://docs.openadminos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openadminos.com/agents/build-your-own-agent.md).

# Build your own Agent

Create and validate a local OpenAdminOS agent from inside the desktop app.

Build your own Agent creates local user-authored agents from inside the desktop app. It is for admins who know the outcome they want but do not want to hand-write a full manifest first.

## Flow

1. Describe the target area, read or write intent, expected output, schedule intent, and whether Teams delivery is useful.
2. OpenAdminOS asks the active LLM provider to draft an agent manifest.
3. The draft is validated against the agent schema and Microsoft Graph checks.
4. If validation fails, OpenAdminOS attempts a repair pass using the exact validation errors.
5. The manifest opens in an editable YAML review pane.
6. Test draft runs a preflight check before Save and install is enabled.

Drafting follows the active provider's data-flow rules. Local providers such as Ollama, LM Studio, and Apple Foundation keep the drafting prompt on the device. Hosted providers such as OpenAI Codex, Anthropic through Claude Code, and Azure OpenAI send the prompt off the device because the selected model is hosted. See the LLM provider matrix for the full lineup.

## Preflight

Preflight checks the provider, manifest shape, Graph scopes, Graph endpoints, connector declarations, settings, and write-confirmation requirements.

For write agents, preflight verifies the confirmation gate but does not apply Graph changes. A write agent still pauses for confirmation every time it produces a non-empty write plan.

## Local Agents

Saved builder agents are local to the device. They appear in the merged agent list without becoming public registry entries.

Existing user-authored agents can be reopened in the builder, edited, tested again, and saved while keeping install settings, schedules, delivery rules, and run history.

## Export

The builder can export an upstream-ready local bundle containing `manifest.yaml`, `README.md`, and `metadata.json`. The bundle can be reviewed privately or used as the starting point for a community submission.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openadminos.com/agents/build-your-own-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
