Ory logo

Agentic Engineering in Practice: Components, Workflow, and Security

What agentic engineering is, the components and step-by-step workflow behind it, and how to secure the agents and MCP servers it relies on.

What Is Agentic Engineering?

Agentic engineering is an approach to software development that uses autonomous AI agents to plan, execute, test, and refine engineering tasks with limited human intervention. It typically involves technologies like Claude Code, OpenAI Codex, or Gemini CLI, which provide AI coding agents powered by frontier large language models (LLMs). These agents can access code repositories, development environments, APIs, testing frameworks, and other engineering tools.

Unlike traditional AI-assisted development, where developers use AI tools to generate code or answer questions, agentic engineering enables AI systems to independently carry out multi-step workflows, make decisions, interact with development tools, and respond to feedback. They can break down complex objectives into smaller tasks, write and modify code, run tests, identify errors, and iterate on solutions.

Advanced implementations use sub-agents to parallelize and speed up complex tasks, and provide specialized agents that work on different stages of the software development lifecycle (SDLC), such as implementation, code review, testing, and documentation.

Agentic engineering vs. vibe coding vs. AI-assisted development: What is the difference?

  • AI-assisted coding: Developers use AI to generate, explain, or improve code while retaining direct control over implementation decisions, testing, and integration.
  • Vibe coding: Developers describe desired functionality in natural language and rely on AI to generate working software, often with limited code review or formal validation.
  • Agentic engineering: Autonomous AI agents plan and execute multi-step development tasks, run tests, and refine code within defined specifications, quality controls, and human oversight.

An agentic engineering workflow, step by step:

  1. Write the spec and acceptance criteria: Define requirements, constraints, and measurable outcomes in a version-controlled specification.
  2. Break the work into small, agent-sized tasks: Create focused, independently verifiable tasks with clear dependencies, deliverables, and acceptance criteria.
  3. Run agents in iterative loops inside sandboxed environments: Let agents implement, test, and refine changes with restricted permissions and explicit iteration limits.
  4. Verify output with tests, linters, and cross-model review: Combine automated checks, direct testing, and independent AI review to identify gaps and failures.
  5. Conduct human review, merge, and deploy: Require human approval, release progressively, and feed lessons back into specifications, tests, and agent instructions.

Agentic Engineering vs. Vibe Coding vs. AI-Assisted Coding

Agentic engineering, vibe coding, and AI-assisted coding all use artificial intelligence to support software development, but they differ in how much autonomy AI systems have, how developers interact with them, and how the resulting code is validated.

AI-assisted coding uses AI tools to help developers complete specific tasks, such as generating functions, suggesting code completions, explaining errors, or writing tests. Developers remain responsible for directing the workflow, making implementation decisions, and integrating AI-generated code.

Vibe coding is a prompt-driven approach in which developers describe the desired application or functionality in natural language and rely heavily on AI to generate and modify the code. The emphasis is on rapid experimentation and achieving working results, often without closely examining the underlying implementation. This makes it useful for prototypes and personal projects, but it can introduce maintainability, reliability, and security risks when generated code is not adequately reviewed.

Agentic engineering takes a more structured approach to autonomous software development. AI agents can independently plan and execute multi-step tasks, interact with development environments, run tests, and refine implementations. Unlike vibe coding, agentic engineering emphasizes defined objectives, engineering standards, automated validation, and human oversight to support reliable development workflows.

AspectAgentic EngineeringVibe CodingAI-Assisted Coding
AI autonomyHigh; agents execute multi-step workflowsHigh code-generation reliance; variable autonomyLow to moderate; developer directs tasks
Developer involvementDefines goals, constraints, and reviews resultsDescribes desired outcomes and iterates through promptsDirectly writes, reviews, and integrates code
Code validationStructured testing, reviews, and quality gatesOften limited or informalDeveloper-managed testing and reviews
Primary use caseComplex development workflows and automationRapid prototyping and experimentationImproving everyday coding productivity

Technology Components Behind Agentic Engineering

Let’s review the core components at play behind the scenes in an agentic engineering project.

Coding Agents and the Plan-Act-Observe Loop

Coding agents are AI-powered systems that can independently execute software engineering tasks, including writing code, debugging applications, running tests, and modifying existing implementations. Unlike basic coding assistants, these agents can make decisions about which actions to take, select appropriate tools, and adjust their approach based on intermediate results. They typically operate within defined objectives and constraints established by developers.

A common execution pattern is the plan-act-observe loop. The agent first analyzes the requested task and develops a plan, then performs an action such as editing a file, executing a command, or running a test. It observes the results, evaluates whether the action achieved the intended outcome, and determines what to do next. This process continues until the task is completed, an error requires intervention, or a predefined execution limit is reached.

Tools and the Model Context Protocol (MCP)

Agentic engineering systems depend on tools that allow AI agents to interact with development environments and external services. These tools may include code editors, terminal commands, Git repositories, CI/CD pipelines, testing frameworks, issue trackers, and cloud infrastructure APIs. Tool access transforms an agent from a system that generates suggestions into one that can perform development tasks.

The Model Context Protocol (MCP) provides a standardized way for AI applications to connect with external tools and data sources. Through MCP servers, coding agents can discover available capabilities and interact with supported services without requiring a separate custom integration for every tool. For example, an agent might use MCP integrations to retrieve project requirements, inspect repository information, or access documentation relevant to a development task.

IAM PerspectiveSep 10, 2026

What Is AI Agent Integration and How to Choose the Right Approach

Ory logo

AI agent integration connects agents to data and actions. Compare custom, iPaaS, MCP, and unified-API approaches, and the identity controls that keep them safe.

Context Files, Memory, and Repository Knowledge

AI agents require accurate information about the codebase, project conventions, and previous decisions to produce consistent results. Context files provide explicit instructions about repository structure, coding standards, architectural constraints, testing requirements, and development workflows. These instructions may be stored in files such as AGENTS.md or tool-specific configuration files that agents can read before beginning work.

Memory extends this capability by preserving useful information across tasks or development sessions. Depending on the implementation, an agent may retain summaries of previous changes, architectural decisions, recurring errors, or important repository relationships. Repository indexing and retrieval mechanisms can also help agents locate relevant code without loading an entire project into the model's context window.

Identity, Authentication, and Permissions for Agents

AI agents need identities and permissions to interact securely with repositories, development tools, cloud environments, and enterprise systems. Because agents may perform actions independently, organizations must establish which agent is executing a task, whose authority it is operating under, and which resources it is permitted to access. Using shared human credentials or unrestricted service accounts makes it difficult to enforce accountability and investigate unauthorized actions.

Agent-specific identities and least-privilege access controls help establish clear security boundaries. Each agent should receive only the permissions required for its assigned responsibilities, preferably through short-lived credentials and narrowly scoped authorization. For example, a coding agent responsible for implementing a feature may need permission to modify a development branch and execute tests but should not automatically receive access to production secrets or deployment environments.

An Agentic Engineering Workflow, Step by Step

Agentic engineering is an emerging field and there are multiple approaches to structuring an agentic development project. Below we propose a workflow inspired by principles agreed on by multiple experts: spec-first development, iterative loops, and using both AI agents and human reviewers for testing and quality control.

Step 1: Write the Spec and Acceptance Criteria

The workflow begins with a specification that defines what the system should and shouldn't do, the constraints it operates under, and the failure modes it must handle. Rather than giving an agent a vague instruction such as "add a login mechanism," developers should describe the specific changes required, relevant architectural considerations, and expected behavior. Clear specifications reduce ambiguity and anchor every later test and review decision.

Acceptance criteria establish measurable conditions for determining whether the work is complete. These may include passing unit tests, meeting API contract requirements, handling specific error scenarios, or maintaining performance thresholds. For example, a specification for a new API endpoint might require defined request and response formats, authentication checks, input validation, and tests covering both successful and unsuccessful requests.

Action items:

  • Audit the codebase first: Have the agent map the files, dependencies, and existing tests the feature touches before you finalize the spec.
  • Spell out production requirements: List authentication, input validation, error handling, retries, and logging explicitly, because agents rarely add them unprompted.
  • Make every criterion testable: Phrase acceptance criteria so each one can be verified by an automated test or a reproducible manual check.
  • List boundaries and approval points: Identify files, dependencies, and APIs the agent must not change, and actions that require human sign-off.
  • Store the spec in the repository: Keep it in a version-controlled Markdown file so agents and reviewers work from the same requirements.
  • Review the spec from several perspectives: Ask different models to read it as an architect, an end user, and a security reviewer to surface blind spots early.

Example prompts:

Read the codebase and identify every file, function, and test related to user authentication. Summarize how sessions are currently handled and list any gaps or inconsistencies that could affect a new password reset feature. Don't write any code yet.
Read docs/specs/password-reset.md three times: as a platform architect, as an end user, and as a security reviewer. For each perspective, list ambiguous requirements, missing edge cases, and acceptance criteria that can't be tested, then suggest specific revisions.

Step 2: Break the Work into Small, Agent-Sized Tasks

Once the specification is established, it should be decomposed into epics and stories that an AI agent can complete and validate independently. Large, loosely defined assignments increase the likelihood of incorrect assumptions, exhausted context windows, and changes that are difficult to review. Smaller tasks provide clearer objectives and produce pull requests that a reviewer can evaluate in one sitting.

Each task should have a defined scope, relevant context, expected deliverables, and verification criteria. For example, an authentication feature could be split into schema updates, API endpoints, session management, tests, and documentation. Independent tasks can run in parallel on separate branches, Git worktrees, or subagents, while dependent tasks should wait until the components they rely on are complete.

Action items:

  • Ask the agent to plan before coding: Have it propose an implementation plan and task breakdown, then review and adjust the plan yourself.
  • Have the agent critique its own plan: Ask for specific improvements covering security, edge cases, and performance, and revise before implementation starts.
  • Give every story its own acceptance criteria: Carry the relevant requirements over from the spec so each story can be verified on its own.
  • Size tasks for a single review: Aim for changes that produce one focused pull request, and split anything that touches many unrelated files.
  • Order tasks by dependency: Complete foundational work, such as data models and interfaces, before features that rely on it.
  • Isolate parallel work: Give each parallel agent its own branch or worktree and assign file ownership to avoid conflicting edits.

Example prompts:

Based on the spec in docs/specs/password-reset.md, write an implementation plan broken into small stories. For each story, list the files it touches, its dependencies, its acceptance criteria, and how it will be tested. Then critique the plan, suggest at least five improvements, and produce a revised version.
Use subagents to update each email template affected by the new reset flow, one template per subagent, and report back with a summary of what changed in each file.

Step 3: Run Agents in Iterative Loops inside Sandboxed Environments

After tasks are assigned, coding agents execute them using the plan-act-observe loop. An agent may inspect files, generate code, run commands and tests, and evaluate the results before deciding on its next action. Code execution is what makes this loop valuable: an agent that can run its own code can detect failures and correct them instead of guessing.

Sandboxed environments isolate agent execution from sensitive systems and production resources. Agents can run inside containers, isolated development environments, or temporary virtual machines with restricted filesystem, network, and credential access. Iterations should also operate within limits on execution time, resources, and retries, with the workflow escalating to a human when an agent repeatedly fails or needs broader permissions.

Action items:

  • Start each session by running the tests: This shows the agent how the test suite works and makes it more likely to test its own changes.
  • Use test-first development: Have the agent write tests, confirm they fail, and then implement the code until they pass.
  • Restrict the sandbox: Run agents in containers or isolated environments with minimal network access and no production credentials.
  • Set iteration limits: Cap run time, retries, and resource usage, and define when the agent should stop and escalate to you.
  • Manage context between iterations: Restate goals and acceptance criteria in each loop, and start a fresh session when the context becomes cluttered.
  • Commit working increments: Have the agent commit after each passing step so you can review progress and roll back failed attempts.

Example prompts:

Run the existing test suite and summarize the results. Then implement story 3 from the plan using test-first development: write the tests, confirm they fail, and make them pass. Commit after each passing step.
You are implementing story 3 from docs/plans/password-reset-plan.md. Limit your changes to this story, but check how they affect the rest of the codebase. Don't leave stubs, placeholders, or TODOs. If a test fails, diagnose the root cause and fix it.

Step 4: Verify Output with Tests, Linters, and Cross-Model Review

Agent-generated code must undergo systematic verification before it can be accepted. Layered tests should cover unit, integration, and end-to-end behavior, with each test tracing back to a requirement in the spec. Because passing tests don't guarantee working software, agents should also exercise the code directly, for example by calling a new API with curl or driving the UI with browser automation.

Cross-model review adds another layer by using a separate AI model to inspect the implementation. A reviewing agent can compare code against the specification, identify missing edge cases, and highlight security or architectural problems. Different models have different blind spots, but agreement between them does not guarantee correctness, so verification should rely on observable results rather than an agent's claims.

Action items:

  • Enforce quality gates in CI: Run tests, linters, type checks, and dependency scans automatically, and block changes that fail.
  • Test failure modes, not just the happy path: Cover invalid inputs, boundary conditions, and recovery behavior, and confirm the system stays within its defined constraints.
  • Have the agent test manually: Ask it to exercise new code with scripts, curl requests, or Playwright, then turn any bugs it finds into regression tests.
  • Use a different model for review: Have a second model check the diff against the spec, or implement the same story and compare the outputs.
  • Use specialist subagents: Assign reviewer or test runner subagents to keep verbose output out of the main agent's context.
  • Feed failures back to the agent: Pass failed checks and review findings to the implementing agent as specific, actionable revision requests.

Example prompts:

Start the dev server and use curl to explore the new /password-reset endpoint. Try valid requests, expired tokens, and malformed input. For any bug you find, write a failing test first and then fix it.
You are reviewing a pull request written by another agent. Compare the diff against docs/specs/password-reset.md and list any unmet acceptance criteria, untested edge cases, and security risks, ranked by severity.

Step 5: Human Review, Merge, and Deployment

Once automated validation is complete, human developers review the proposed changes before integrating them into the main codebase. Reviewers should evaluate whether the implementation satisfies the specification, follows established architectural patterns, and avoids security or maintainability risks. The engineer who directed the agent owns the first review pass and should never file a pull request containing code they haven't reviewed.

Human approval gates are particularly important for changes involving authentication, sensitive data, infrastructure, or production deployments. Branch protection rules and mandatory reviews prevent agents from approving and merging their own changes. After approval, progressive deployment strategies such as canary releases limit the impact of unexpected behavior, while incidents and review findings should feed back into specs, tests, and agent instructions.

Action items:

  • Review the code before opening a pull request: Confirm that it works yourself, and check the agent's pull request description for accuracy.
  • Include evidence of testing: Add manual testing notes, screenshots, or test output so reviewers know the change has been verified.
  • Ask for a walkthrough of unfamiliar code: Have the agent explain the changes step by step, using real code snippets, before you approve them.
  • Protect the main branch: Require human approval for merges and keep agent identities attached to every commit for accountability.
  • Deploy progressively: Use canary or staged rollouts with production monitoring and a tested rollback plan.
  • Update the spec and agent instructions: Log what was built in the spec, and record lessons from reviews in context files such as AGENTS.md.

Example prompts:

Review all changes on this branch against the spec. Check security, error handling, logging, and deployment readiness, and confirm that every acceptance criterion is met. Then write a pull request description that links to the spec and explains how each change was tested.
Read the diff for this branch and give me a linear walkthrough of how the new reset flow works. Quote the relevant code directly from the files.

Security and Access Control for AI Agents and MCP Servers: What You Should Know

Main Risks: Prompt Injection, Tool Poisoning, and Leaked Credentials

AI agents are vulnerable to attacks that manipulate their behavior through untrusted content or compromised tools:

Prompt injection occurs when attackers embed malicious instructions in repository files, documentation, tool responses, or other information processed by an agent. These instructions may attempt to override the agent's original task, extract sensitive information, or trigger unauthorized actions.

Tool poisoning targets the tools and integrations agents rely on, particularly MCP servers. Attackers may modify tool descriptions, manipulate responses, or introduce malicious MCP servers that appear legitimate.This makes tool provenance, server allowlisting, and validation of tool responses important security controls.

Leaked credentials create another significant risk. Agents may encounter API keys, access tokens, SSH credentials, and other secrets while working with repositories or development environments. If these credentials appear in prompts, logs, or external tool requests, attackers may gain unauthorized access to connected systems.

Authenticating Agents with OAuth 2.1 and PKCE

OAuth 2.1 provides the authorization framework used by protected HTTP-based MCP integrations, allowing clients to obtain access tokens without handling users' passwords directly. In an agentic engineering environment, an MCP client can use OAuth to request access to protected tools and resources on behalf of an authenticated user. The authorization server evaluates the request and issues tokens that the MCP server validates before granting access.

Proof Key for Code Exchange (PKCE) strengthens the authorization code flow by protecting against authorization code interception and injection attacks. The client generates a cryptographic verifier and sends a derived challenge during authorization. When exchanging the authorization code for tokens, the client must present the original verifier. This helps prevent an attacker who intercepts an authorization code from redeeming it independently. The MCP authorization specification requires PKCE for clients using its OAuth authorization flow.

Securing MCP Servers with Dynamic Client Registration and Scoped Tokens

MCP servers expose tools and resources that AI agents can access, making client registration and token management essential security controls.

Dynamic Client Registration (DCR) allows MCP clients to register with authorization servers programmatically rather than requiring administrators to configure every connection manually. However, DCR must be controlled to prevent unauthorized applications from registering or impersonating trusted clients.

The MCP authorization specification also supports pre-registration and OAuth Client ID Metadata Documents. In the July 2026 specification, Client ID Metadata Documents are the preferred discovery-oriented approach when supported, while DCR is retained primarily for backward compatibility. Organizations should validate client identities, restrict registration where appropriate, and ensure that authorization servers apply consistent trust policies regardless of registration method.

Scoped access tokens restrict which resources and operations a client can access. Instead of granting broad administrative permissions, MCP clients should request only the scopes necessary for the current task. MCP servers must validate token audiences to ensure that presented tokens were issued specifically for them, and must not forward incoming client tokens directly to downstream APIs. Short-lived, audience-restricted tokens reduce the impact of credential theft and help prevent unauthorized access across connected services.

Fine-Grained, Least-Privilege Permissions for Agent Actions and Delegated User Access

Agentic engineering systems require authorization controls that operate beyond basic authentication and broad API scopes.

Fine-grained permissions determine which actions an agent can perform, which resources it can access, and under what conditions those actions are allowed. For example, an agent may be authorized to read repository files and create pull requests but prohibited from modifying protected branches, accessing production secrets, or initiating deployments.

Least-privilege access limits each agent to the minimum permissions required for its assigned tasks. Organizations can enforce these restrictions using role-based access control (RBAC), attribute-based access control (ABAC), or policy-based authorization systems. Permissions may also depend on contextual factors such as the agent's identity, assigned task, environment, resource sensitivity, and requested operation. Just-in-time access can provide temporary elevated permissions when needed without granting permanent privileges.

Delegated user access introduces additional requirements. When an agent acts on behalf of a developer, the system should preserve both the agent's identity and the user's authorization context. The agent should not gain more access than the delegating user possesses or exceed its own policy boundaries.

IAM PerspectiveAug 31, 2026

Best IAM Solutions for Corporate Security

Ory logo

Compare the best IAM solutions for corporate security, from Okta and Entra ID to Ory and Keycloak, and learn how to evaluate the right fit for your stack.

Audit Trails and Human Approval for High-Risk Agent Actions

AI agents may perform hundreds of actions across repositories, development tools, and connected services during a single engineering workflow.

Audit trails provide a record of these activities, enabling organizations to investigate security incidents, identify unauthorized behavior, and demonstrate compliance with internal policies. Logs should capture agent identities, delegated user identities, tool invocations, accessed resources, authorization decisions, execution results, and relevant timestamps.

Audit records should also preserve relationships between actions so security teams can reconstruct how an agent reached a particular decision. For example, an audit trail might connect a developer's original request to the agent's execution plan, MCP tool calls, repository modifications, and deployment attempts.

Human-in-the-loop approval provides an additional safeguard for operations with significant security or business consequences. Organizations can require explicit authorization before agents delete data, modify production infrastructure, change access policies, access sensitive information, or deploy code to critical environments. Approval requests should explain the proposed action, affected resources, and potential impact.

Agentic Engineering Best Practices

Build a Reusable Library of Proven Code Examples

One of the most valuable resources for agentic engineering is a collection of working code examples that agents can reference and adapt. Instead of repeatedly asking agents to solve technical problems from scratch, developers can maintain a repository of tested implementations, proof-of-concept applications, integration examples, and solutions to recurring engineering challenges. This helps agents build on approaches that are already known to work.

For example, an organization might maintain examples of database migrations, API integrations, authentication flows, frontend components, and infrastructure configurations. When implementing new functionality, agents can inspect these examples and combine relevant patterns into a new solution. This is especially useful for unfamiliar technologies or integrations that involve multiple frameworks.

Organizations should maintain these examples as executable projects rather than relying exclusively on written documentation. Include dependency versions, environment requirements, and instructions for reproducing the demonstrated behavior. Periodically verify that the examples still work as technologies evolve.

Use Agents to Compare Competing Architectural Approaches

Traditional software engineering often requires teams to choose an architectural approach before investing significant development time. Agentic engineering reduces the cost of experimentation, allowing developers to evaluate multiple implementations before committing to a design. Rather than accepting the first architecture proposed by an agent, teams can use coding agents to investigate alternative approaches and build working prototypes.

For example, when selecting a database technology for a high-throughput application, agents can implement comparable prototypes using different databases, generate representative workloads, and measure performance under similar conditions. The resulting evidence can help engineers evaluate scalability, implementation complexity, operational requirements, and maintainability.

Key implementation practices:

  • Prototype competing solutions: Have agents create minimal implementations of two or three viable approaches rather than developing one solution in full.
  • Use realistic evaluation criteria: Compare alternatives against representative workloads, integration constraints, and operational requirements.
  • Record architectural tradeoffs: Document why one approach was selected and which limitations might require reconsideration.
  • Discard unsuccessful experiments: Treat exploratory implementations as disposable unless they demonstrate clear value.

Use Agentic Workflows to Reduce Technical Debt

Coding agents create opportunities to address technical debt that organizations previously postponed because remediation required too much development effort. Tasks such as renaming inconsistent APIs, consolidating duplicate functionality, splitting oversized modules, and updating outdated interfaces can be conceptually straightforward but labor-intensive.

Organizations can assign agents to these maintenance activities alongside feature development, helping improve code quality without constantly competing for the same engineering resources. For example, an agent could identify several implementations of similar validation logic, consolidate them into a shared component, and update the affected callers while preserving existing behavior.

The objective should be to improve the codebase rather than simply generate more code. Teams should prioritize removing unnecessary complexity, eliminating duplication, and making existing systems easier to understand and modify. This approach also helps prevent new technical debt by making previously expensive improvements more practical.

Use Interactive Explanations to Understand Unfamiliar Code

Coding agents can be valuable tools for understanding existing software, not just generating new implementations. Instead of manually tracing an unfamiliar feature through numerous files, developers can ask an agent to explain how the system operates, identify dependencies, and illustrate the flow of data between components.

An effective technique is to have agents create interactive explanations of complex behavior. For example, an agent could produce a visual representation of an application's request-processing pipeline, showing how requests move through routing, middleware, business logic, and database operations. Developers can use these explanations to investigate specific components and understand how changes might affect the wider system.

These explanations are especially useful during onboarding, legacy system maintenance, and architectural investigations. Require agents to reference actual code locations and distinguish verified behavior from assumptions. Keep generated explanations synchronized with the implementation when using them as long-term documentation.

Treat Agent Instructions as Continuously Improving Engineering Assets

Agent instructions should evolve as teams discover which approaches produce reliable results and which lead to recurring problems. Rather than treating prompts and configuration files as one-time setup activities, organizations can maintain a structured process for converting engineering experience into reusable agent guidance.

For example, if an agent repeatedly introduces incompatible dependency versions or uses an outdated application pattern, the team can update its instructions with the preferred implementation and references to working examples. Successful approaches can similarly become reusable templates, scripts, or development conventions.

This creates a feedback loop in which completed projects improve future agent performance. Teams should periodically review instructions, remove obsolete guidance, and evaluate whether updates actually reduce recurring errors. Keep instructions concise and focused so that accumulating historical guidance does not make agent behavior less predictable.

Separate Agent Authentication from Action-Level Authorization

Authenticating an AI agent establishes which system or workload is making a request, but it does not determine whether every action that agent attempts should be permitted. Agentic engineering environments should distinguish authentication from authorization and evaluate access at the level of individual operations and resources.

For example, an agent may have valid credentials to interact with a project management platform but should not automatically be able to modify every project, approve its own requests, or access another customer's records. Authorization decisions should consider the requested operation, the target resource, the agent's assigned responsibilities, and the applicable organizational policies.

Key implementation practices:

  • Enforce resource-level authorization: Check access to individual repositories, projects, documents, and other protected objects rather than relying exclusively on broad application permissions.
  • Separate machine and user authorization: Use appropriate authentication flows for autonomous service interactions and delegated user operations.
  • Centralize policy evaluation: Apply consistent authorization rules across APIs, development tools, and connected services.
  • Test authorization boundaries: Verify that agents cannot access neighboring projects, unrelated resources, or data belonging to another tenant.

Reevaluate Authorization When Agent Workflows Change

AI agents can dynamically change their execution plans, invoke new tools, and initiate operations that were not anticipated when a task began. An authorization decision made at the beginning of a session should therefore not be treated as permission for every subsequent action.

Organizations should reevaluate access when agents move between resources, request sensitive operations, or transition into workflows with different security requirements. For example, permission to inspect a development environment should not implicitly authorize an agent to modify production configuration after discovering that a task requires deployment-related changes.

Authorization systems should also account for changes in user permissions, resource ownership, and organizational policies during long-running agent sessions. When an agent's delegated authority is revoked or a task changes substantially, subsequent operations must respect the updated authorization state. This requires authorization checks close to the point of execution rather than relying solely on permissions established at session initialization.

Design Authorization Services for Reliability and Consistency

Agentic engineering workflows may perform large numbers of authorization checks across repositories, APIs, cloud environments, and MCP integrations. When different services enforce inconsistent policies, agents may receive conflicting access decisions or exploit gaps between authorization boundaries.

Organizations should use a consistent authorization model that can operate across distributed applications and services. Fine-grained policy enforcement should provide sufficiently low latency to support frequent agent actions without creating significant workflow bottlenecks. Access decisions must also account for the timing of permission changes, particularly when policies are cached or replicated across environments.

For high-risk operations, systems should avoid using stale authorization decisions after access has been revoked. Organizations should define clear behavior for policy-service failures, including denying sensitive operations when permissions cannot be verified. Monitoring authorization latency, availability, and decision consistency helps ensure that security controls remain effective as agent deployments scale.

Securing Agentic Engineering Workflows with Ory Agent Security

Ory Agent Security is a control plane for AI coding agents that brings identity, authorization, and governance into the agent harnesses developers already use, including Claude Code, Codex, Gemini CLI, OpenClaw, and OpenCode. AI coding agents can read repositories, run shell commands, write files, call internal APIs, and open pull requests with the developer's authority, often inheriting permissions that exceed what their tasks require. Ory closes this gap by giving every agent its own identity, scoped to what it actually needs and revocable, and by checking each agent action against policy at the point of execution. Teams can start by observing agent activity at no cost and add enforcement when they're ready.

Key capabilities of Ory Agent Security:

  • Authenticated agent identities: Ory resolves the agent's identity inside the harness, whether it was started by a human, another agent, or a headless process. Every agent and sub-agent authenticates with its own credentials before acting, and the delegation chain back to the user or upstream agent is recorded before any tool runs.
  • Fine-grained authorization for agent actions: Before an agent action runs, Ory checks the requested tool against Ory Keto (Permissions). Shell commands, file writes, web fetches, MCP tools, and API calls are governed by the same Zanzibar-style permission model used for human access.
  • Enforcement that fits your risk tolerance: Every agent action hits a decision point before it runs. Teams can observe first and enforce when ready, by category or down to the individual command, and cut off any agent instantly.
  • OAuth 2.1 authorization for MCP servers: Ory checks whether an agent session may use a given MCP server, with optional checks for individual tools within that server.
  • Full observability and audit trails: Every permission check, tool call, and sub-agent start is recorded, including who started the session, which agent acted, what it attempted, and which policy decided. Actions are exported through OpenTelemetry to your SIEM, and the trail holds even after credentials expire.
  • Coverage across the agent security lifecycle: Four interconnected capabilities (Observe, Enforce, Build, and Deploy) let teams discover agent behavior, apply identity-aware controls, embed identity and guardrails into agents through APIs, SDKs, and plugins, and extend consistent security across growing deployments.
  • Broad framework and harness support: Beyond coding-agent plugins, Ory ships SDK controllers for CrewAI, LangGraph, LangChain, and Microsoft Agent Framework, and integrates with runtime and delivery targets such as Temporal and Jamf Pro.

Ready to see what your coding agents are actually doing? Learn more about Ory Agent Security

Featured

← Back to Learning Center

Try Ory today Start for free