agentleFS
MicrosoftKnown publishermicrosoft/agent-framework/python/packages/declarative/AGENTS.md

agent-framework / declarative

AGENTS.md14k starsChanged 10 months agoMITView on GitHub

YAML/JSON-based declarative agent and workflow definitions. Both state classes validate object attribute names but leave dictionary keys unchanged. DefaultMCPToolHandler caches/coalesces sessions only without a client_provider. With a provider, every invocation (including tools/list) gets a fresh tool/session, even if the provider returns None or a shared HTTP client. Invocation cleanup closes the session and any internally owned fallback client, never caller-owned HTTP clients. Shutdown waits for active provider-backed invocations to clean up. Calling aclose() from an active invocation's context (including inherited…

Trending

More talk lately.about the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 1 mentionMar 2026: 3 mentionsApr 2026: 5 mentionsMay 2026: 3 mentionsJun 2026: 1 mentionJul 2026: 1 mentionAug 2026: 1 mentionSep 2026: 3 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/agent-framework repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/agent-framework

The biggest 5 of 31 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 31

Talked about on GitHub, Bluesky and Hacker News (31 times).

On GitHub · 17

12 more on GitHub

On Bluesky · 10

5 more on Bluesky

The file

We split this AGENTS.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only the opaque binding and header names enter the approval payload.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Declarative Package (agent-framework-declarative)

YAML/JSON-based declarative agent and workflow definitions.

Main Classes

  • AgentFactory - Creates agents from declarative definitions
  • WorkflowFactory - Creates workflows from declarative definitions
  • WorkflowState - Standalone state management and expression evaluation; factory-created workflows use the internal, checkpoint-backed DeclarativeWorkflowState instead
  • ProviderTypeMapping - Maps provider types to implementations
  • HttpRequestHandler / DefaultHttpRequestHandler - Pluggable HTTP transport for the HttpRequestAction declarative action (configured via WorkflowFactory(http_request_handler=...))
  • MCPToolHandler / DefaultMCPToolHandler - Pluggable MCP transport for the InvokeMcpTool declarative action (configured via WorkflowFactory(mcp_tool_handler=...))
  • DeclarativeLoaderError / ProviderLookupError / DeclarativeWorkflowError / DeclarativeActionError - Error types

Both state classes validate object attribute names but leave dictionary keys unchanged.

MCP Handler Lifetimes

DefaultMCPToolHandler caches/coalesces sessions only without a client_provider. With a provider, every invocation (including tools/list) gets a fresh tool/session, even if the provider returns None or a shared HTTP client. Invocation cleanup closes the session and any internally owned fallback client, never caller-owned HTTP clients. Shutdown waits for active provider-backed invocations to clean up. Calling aclose() from an active invocation's context (including inherited child tasks and cleanup) raises RuntimeError before changing handler state; shutdown must run outside that context or after invocation completion.

Per-invocation sessions intentionally add connection overhead and lose server session continuity between invocations; shared session ownership requires an explicitly scoped custom MCPToolHandler.

MCP Approval Context

InvokeMcpToolActionExecutor binds evaluated headers to each request with a workflow-local HMAC key held separately in trusted host checkpoint state. Only the opaque binding and header names enter the approval payload; raw headers are not checkpointed. Changed or unverifiable headers produce a replacement request for the same pinned operation, with a fresh request ID and no dispatch. Fresh executors verify unchanged approvals using the checkpointed key; legacy requests or missing verification state require reapproval for non-empty headers. Custom handlers remain responsible for identity changes in credentials they resolve outside the action's headers.

InvokeAzureAgent uses Core's executor-ready kwargs conversion for both modern and legacy state, without copying workflow/client kwargs into additional tool arguments. Explicit caller tool arguments in options are preserved.

External Input Handling

  • ExternalInputRequest / ExternalInputResponse - Human-in-the-loop support
  • AgentExternalInputRequest / AgentExternalInputResponse - Agent-level input requests

Usage

from agent_framework.declarative import AgentFactory, WorkflowFactory

# Create agent from YAML file
agent_factory = AgentFactory()
agent = agent_factory.create_agent_from_yaml_path("agent.yaml")

# Create workflow from YAML file
workflow_factory = WorkflowFactory()
workflow = workflow_factory.create_workflow_from_yaml_path("workflow.yaml")

Import Path

from agent_framework.declarative import AgentFactory, WorkflowFactory
# or directly:
from agent_framework_declarative import AgentFactory

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.