# ory-build-agent

> Claude/Codex skill by [@ory](https://omgskills.com/library/ory/index.md) · 3 stars · Updated 2026-09-30

Build your own AI agent that authenticates the user, authorizes every tool call against Ory Permissions, and records structured activity — by dropping \`@ory/argus\` directly into the Claude Agent SDK, OpenAI Agents SDK, Mastra, Vercel AI SDK, PydanticAI / LangGraph, or as an external service called by Salesforce Agentforce. Use when the user wants to wire Ory into a custom agent they own — phrases like "add Ory to my own agent", "build a custom agent with Ory auth", "wrap my Claude Agent SDK tools with Ory permissions", "OpenAI Agents SDK with Ory", "Mastra agent with Ory permissions", "Agentforce action with Ory", "use \`@ory/argus\` directly". For wiring Ory into an existing agent harness (Claude Code, Codex, Gemini CLI, OpenClaw, OpenCode) use the corresponding \`@ory/\<harness\>\` plugin instead.

## Install

```sh
git clone https://github.com/ory/claude-plugins /tmp/claude-plugins && ln -s /tmp/claude-plugins/plugins/ory-agent-plugin/skills/ory-build-agent ~/.claude/skills/ory-build-agent
```

## From README

Build your own agent with @ory/argus You are helping the user wire Ory Identities, Permissions, and activity auditing into an agent they are building themselves. They are not extending Claude Code, Codex, or one of the other harness plugins — they own the agent loop and choose where to intercept tool calls. The integration is the same three moves regardless of SDK: Session start. sessionStart(client, …) runs user and agent identity, delegation, permission-mode warming, and fail-open handling. Permission check on every tool call. Wrap the SDK's tool dispatch with gate(client, …) and translate result.blocked into the SDK's veto signal. Completion. Call complete(client, …) after the tool returns. @ory/argus ships every helper and handles fail-open semantics (network errors, rate limits, unconfigured project → allow). The SDKs differ only in where that wrapper goes.

## Links

- HTML page: https://omgskills.com/library/ory/claude-plugins/plugins/ory-agent-plugin/skills/ory-build-agent/
- GitHub: https://github.com/ory/claude-plugins
- Author: [@ory](https://omgskills.com/library/ory/index.md)

## More from this repo

- [ory-auth-setup](https://omgskills.com/library/ory/claude-plugins/plugins/ory-agent-plugin/skills/ory-auth-setup/index.md) — Set up a complete authentication system using Ory Network with Ory Elements as the UI layer.
   - [@ory](https://omgskills.com/library/ory/index.md) · 3 stars
- [ory-build-integration](https://omgskills.com/library/ory/claude-plugins/plugins/ory-agent-plugin/skills/ory-build-integration/index.md) — Wire an Ory Network integration into your own application using the ory/integrates template patterns.
   - [@ory](https://omgskills.com/library/ory/index.md) · 3 stars
- [ory-contribute-integration](https://omgskills.com/library/ory/claude-plugins/plugins/ory-agent-plugin/skills/ory-contribute-integration/index.md) — Author a new Ory Network integration as a contribution to the public ory/integrates repository.
   - [@ory](https://omgskills.com/library/ory/index.md) · 3 stars
