AgentDefinitionResource

Declarative Agent Blueprints

Agent definitions are executable blueprints decoupled from any specific runtime SDK. Define once in YAML, deploy across Agno, CrewAI, or OpenAI Agents with the same governance and lifecycle management.

AgentDefinitionResource Schema

Define agents as YAML specs following the Open Agentic Resource Specification

customer-support.yaml
type: agent_definition
enabled: true
version: "0.1"
metadata:
  display_name: Customer Support Agent
  description: Handles support tickets
spec:
  name: customer-support
  engine: agno  # or crewai, openai_agent
  definition:
    model: openai-gpt-4o
    instructions: |
      You are a customer support agent.
      Be helpful, concise, and professional.
      Never share internal policies.
    tools:
      - ticket-lookup
      - knowledge-search
  resources:
    prompts:
      - support-system-prompt
    guardrails:
      - pii-redaction
      - jailbreak-defense
    knowledge:
      - product-docs
      - faq-database

Key Fields

  • engine — The underlying SDK runner: agno, crewai, openai_agent
  • definition — SDK-specific payload (instructions, tools, memory)
  • resources — References to prompts, knowledge, guardrails by name

Supported Engines

AgnoFull support with executor
CrewAIFull support with executor
OpenAIFull support with executor
Deployment Patterns

Wrap or Load

Two ways to deploy agents—both get full governance through the Controller

Pattern 1: Wrap Existing Agents

Add governance to your existing agent code with zero config

from agno import Agent
from ev_core import EV

# Your existing agent
agent = Agent(
    model="gpt-4o",
    instructions="You are a helpful assistant"
)

# Wrap with EV - policies auto-apply
executor = await EV.build_executor(agent)

# Guardrails run at every lifecycle hook
response = await executor.run(
    task="Help me draft release notes"
)

# EV.build_executor() automatically:
# - Detects the framework (Agno, CrewAI, etc.)
# - Applies configured guardrails
# - Tracks lifecycle events for observability

Pattern 2: Load from Definition

Build agents from declarative YAML definitions

from ev_core import EV
from ev_core.control.operators.agents import (
    AgentDefinitionOperationContext,
    AgentDefinitionOperationType,
    BuildAgentDefinitionParams,
)

# Load agent from YAML definition
executor = await EV.operate(
    AgentDefinitionOperationContext(
        operation=AgentDefinitionOperationType.BUILD,
        params=BuildAgentDefinitionParams(
            name="customer-support"
        )
    )
)

# Complete definition loaded from registry:
# - Prompts
# - Tools
# - Guardrails
# - Knowledge bases
response = await executor.run(task="Handle ticket #1234")

Resources as Boundaries

When resources are attached to an agent, they define its operational boundaries. An agent can only access the MCP connectors, knowledge bases, and tools that are explicitly declared. This ensures deterministic, auditable behavior.

  • Explicit Tool Access
    Agents can only call tools listed in their definition
  • Scoped Knowledge
    RAG queries limited to declared knowledge bases
  • Enforced Guardrails
    Policies apply automatically at every lifecycle hook
Agent Boundary Example
# This agent can ONLY:
# - Use the ticket-lookup tool
# - Search product-docs knowledge
# - Have PII redacted from I/O

spec:
  name: support-agent
  definition:
    tools:
      - ticket-lookup  # ✓ allowed
      # - admin-panel  # ✗ not declared
  resources:
    knowledge:
      - product-docs   # ✓ searchable
      # - hr-policies  # ✗ not declared
    guardrails:
      - pii-redaction  # ✓ enforced

Framework Resolvers

Resolvers translate declarative resources into runtime artifacts. Like Terraform providers, each engine has a resolver that builds the SDK agent.

Agno

AgnoResolverProvider

Resolves to Agno Agent with tools, memory, and instructions

CrewAI

CrewAIResolverProvider

Resolves to CrewAI Agent with role, goal, and backstory

OpenAI

OpenAIAgentResolver

Resolves to OpenAI Agents SDK with function calling

Extend with custom resolvers by implementing ResolverProvider and calling register_resolver_provider()

Build Governed Agents

Define agents declaratively, enforce policies automatically, deploy across any framework.

Explore Prompts