Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

agent-did-microsoft-agent-framework

Integracion funcional de Agent-DID para Microsoft Agent Framework con foco en Python.

Esta variante usa el paquete oficial agent-framework documentado en Microsoft Learn y ya no se limita a wiring basico de Agent(...): ahora cubre helpers nativos para AgentExecutor y WorkflowBuilder, observabilidad especializada con OpenTelemetry, recipes operativas profundas y validacion automatizada de runtime/orquestacion sin depender de proveedores externos.

Estado

  • Estado actual: functional
  • Roadmap: F2-09
  • Lenguaje objetivo: Python
  • Runtime objetivo: agent-framework>=1.0.1,<2
  • Implementacion: funcional para tools nativas, Agent, AgentExecutor, WorkflowBuilder, observabilidad saneada y recipes operativas multi-step

Con el estado actual, la claim correcta para F2-09 ya no es solo “MVP de wiring basico”. El paquete tiene cierre operativo para el alcance gobernado en runtime/orchestrations, observabilidad y recipes, con CI dedicada y artefactos de gobernanza equivalentes al resto de integraciones Python del repositorio.

Hallazgos tecnicos confirmados

La documentacion oficial en Microsoft Learn y el runtime validado en local confirman superficies utiles para una integracion Agent-DID en Python:

  • Agent como host principal con instructions, tools, middleware y context_providers.
  • tool(...) y FunctionTool como superficie nativa para exponer herramientas.
  • AgentSession para continuidad conversacional sin exponer secretos en prompts.
  • AgentExecutor como unidad reusable para orquestaciones.
  • WorkflowBuilder y Workflow.run(...) como superficie real para workflows multi-step.
  • observabilidad nativa basada en OpenTelemetry dentro del propio runtime.

Objetivo

Integrar Agent-DID como capa de identidad verificable para agentes y workflows construidos sobre Microsoft Agent Framework, con foco en:

  • exponer el DID actual y capacidades verificables del agente,
  • resolver documentos DID y verificar firmas desde tools nativas del host,
  • habilitar firma de payloads y firma HTTP solo mediante opt-in,
  • soportar secuencias de workflow y orquestacion sin perder continuidad de identidad,
  • mantener la clave privada fuera del prompt y del contexto visible al modelo.

Uso rapido

Instalacion recomendada, con el runtime validado fijado:

pip install agent-did-microsoft-agent-framework==1.0.0rc4 agent-framework==1.24.0

agent-framework es un meta-paquete que arrastra unos 30 subpaquetes agent-framework-*. Sin fijar la version, pip puede tardar varios minutos en resolver dependencias (~7.5 min medidos en el smoke del RC).

from agent_did_microsoft_agent_framework import create_agent_did_microsoft_agent_framework_integration

integration = create_agent_did_microsoft_agent_framework_integration(
  agent_identity=agent_identity,
  runtime_identity=runtime_identity,
  expose={"sign_payload": True, "rotate_keys": True},
)

agent = integration.create_agent(
  client=chat_client,
  name="Verifier",
  base_instructions="Use Agent-DID tools when verifiable identity evidence is required.",
)
executor = integration.create_agent_executor(agent, executor_id="verifier_executor")
workflow = integration.build_workflow_chain([executor], name="identity_workflow")

El bundle devuelto incluye:

  • tools: FunctionTool nativas de Agent Framework.
  • get_current_identity() y get_current_document().
  • get_tool(...) para resolver tools por nombre sin duplicar wiring manual.
  • compose_instructions(...).
  • create_agent_kwargs(...) para inyectar instructions y tools.
  • create_agent(...) para construir un Agent listo para usar con el cliente del host.
  • create_agent_executor(...) para adaptarlo a orquestaciones.
  • create_function_executor(...) para reducers y handlers tipados compatibles con fan-in.
  • create_workflow_builder(...) y build_workflow_chain(...) para recipes y runtime coverage de workflows.
  • build_fan_out_fan_in_workflow(...), build_multi_selection_workflow(...) y build_switch_case_workflow(...) para patrones avanzados del runtime.
  • add_verified_handoff(...) sobre el WorkflowBuilder para insertar verificacion de identidad en los bordes de handoff con TTL por action_class (ver seccion de abajo).

Verified handoffs (add_verified_handoff)

Inserta un verificador de Agent-DID en el borde entre dos executors de un workflow. Hard gate fail-closed con TTL por action_class, soporte de la race condition de rotacion de llave durante el handoff y disposicion de bloqueo via excepcion tipada (default) o callback opt-in.

from agent_did_microsoft_agent_framework import (
    SignedHandoffMessage,
    VerificationBlockedError,
    create_agent_did_microsoft_agent_framework_integration,
)

integration = create_agent_did_microsoft_agent_framework_integration(...)

builder = integration.create_workflow_builder(start_executor=intake)
builder.add_edge(intake, enrichment)
builder.add_verified_handoff(
    from_executor=enrichment,
    to_executor=execution,
    action_class="reversible",        # irreversible | compensable | reversible
    allowed_dids=["did:wba:trusted"],
    require_signature=True,
    on_verification_blocked=None,     # default = raise VerificationBlockedError
    output_type=str,
)

Defaults TTL (overridables por workflow, no por encima de los topes para irreversible y cross-domain):

action_class TTL default
irreversible 30 s (no widenable)
compensable 120 s
reversible 300 s

Reglas adicionales:

  • Cross-domain hops fuerzan re-verify (TTL = 0).
  • Dentro del TTL: si la firma fue emitida bajo la llave previa y el agente roto su llave, se acepta via verify_historical_signature del SDK central.
  • Fuera del TTL: solo se acepta firma contra el current key set; si la llave previa fue revocada -> VerificationBlockedError(failing_gates=["key_lifecycle"]).

Disposicion de bloqueo:

  • Default: levanta VerificationBlockedError(result, failing_gates, enforcement_note, checked_did, action_class).
  • Opt-in: si registras on_verification_blocked=callback, recibe el mismo error. Devolver None detiene el workflow grasiosamente; devolver cualquier otro valor lo emite via ctx.send_message(...) como salida del verificador.

Observabilidad:

  • agent_did.workflow.handoff_verified en exitos (incluye from_did, action_class, ttl_seconds, decision_reason).
  • agent_did.workflow.handoff_blocked en bloqueos (incluye failing_gates, decision_reason).

Ejemplo end-to-end: examples/agent_did_microsoft_agent_framework_verified_handoff_example.py.

Credito de diseno

El diseno de esta API surgio de una conversacion publica con @haroldmalikfrimpong-ops en microsoft/agent-framework#4842. Hilos de referencia:

Tools expuestas por defecto

  • agent_did_get_current_identity
  • agent_did_resolve_did
  • agent_did_verify_signature

Tools opt-in

  • agent_did_sign_payload
  • agent_did_sign_http_request
  • agent_did_rotate_key
  • agent_did_get_document_history

Runtime y orquestacion

La validacion automatizada ya no se limita a Agent(...) y aceptación del bundle. Ahora cubre tambien:

  • construccion de AgentExecutor
  • armado de cadenas con WorkflowBuilder
  • ejecucion real de un workflow multi-step con dos agentes stub
  • patrones avanzados de fan-out, fan-in, multi-selection y switch-case
  • continuidad de identidad a traves de firma, verificacion, rotacion de claves e historial documental antes y despues del workflow

Recetas operativas

Receta 1: workflow de identidad multi-step

Use esta receta cuando quiera validar una secuencia real de orquestacion con dos agentes y herramientas Agent-DID sin depender de un proveedor externo:

  • firma antes de rotacion
  • rotacion de clave activa
  • firma despues de rotacion
  • consulta de historial documental
  • workflow planner → reviewer con WorkflowBuilder

Ejecute:

cd integrations/microsoft-agent-framework
python -m pip install -e .[dev]
python examples/agent_did_microsoft_agent_framework_workflow_recipe_example.py

Artefacto runnable asociado:

  • examples/agent_did_microsoft_agent_framework_workflow_recipe_example.py

Receta 2: patterns avanzados de workflow

Use esta receta cuando quiera validar patrones nativos adicionales del runtime:

  • fan-out hacia ramas paralelas
  • fan-in a un reductor final
  • multi-selection basado en funcion de seleccion
  • switch-case con Case y Default

Ejecute:

cd integrations/microsoft-agent-framework
python -m pip install -e .[dev]
python examples/agent_did_microsoft_agent_framework_advanced_workflow_recipe_example.py

Artefacto runnable asociado:

  • examples/agent_did_microsoft_agent_framework_advanced_workflow_recipe_example.py

Receta 3: recipe production-style con sesiones y observabilidad compuesta

Use esta receta cuando quiera validar operacion mas cercana a produccion sin credenciales externas:

  • continuidad de sesion con AgentSession
  • firma de payload
  • firma HTTP opt-in
  • rotacion de clave activa
  • historial documental
  • workflow multi-step
  • fan-out de observabilidad a memoria, JSON logging y OpenTelemetry

Ejecute:

cd integrations/microsoft-agent-framework
python -m pip install -e .[dev]
python examples/agent_did_microsoft_agent_framework_production_recipe_example.py

Artefacto runnable asociado:

  • examples/agent_did_microsoft_agent_framework_production_recipe_example.py

Observabilidad

La integracion emite eventos saneados y puede proyectarlos a JSON logging o a spans OpenTelemetry:

from agent_did_microsoft_agent_framework.observability import (
  compose_event_handlers,
  create_json_logger_event_handler,
  create_opentelemetry_event_handler,
  create_opentelemetry_tracer,
)

Eventos relevantes cubiertos por la integracion:

  • agent_did.identity_snapshot.refreshed
  • agent_did.tool.started
  • agent_did.tool.succeeded
  • agent_did.tool.failed
  • agent_did.workflow.executor_created
  • agent_did.workflow.function_executor_created
  • agent_did.workflow.builder_created
  • agent_did.workflow.chain_built
  • agent_did.workflow.fan_out_fan_in_built
  • agent_did.workflow.multi_selection_built
  • agent_did.workflow.switch_case_built

La redaccion cubre payload, body, signature, headers sensibles y URLs con credenciales o query strings.

Validacion local

cd sdk-python
python -m pip install -e .[dev]
cd ../integrations/microsoft-agent-framework
python -m pip install -e .[dev]
python -m ruff check src tests examples
python -m mypy src
python -m pytest tests -q
python examples/agent_did_microsoft_agent_framework_mvp_example.py
python examples/agent_did_microsoft_agent_framework_workflow_recipe_example.py
python examples/agent_did_microsoft_agent_framework_advanced_workflow_recipe_example.py
python examples/agent_did_microsoft_agent_framework_production_recipe_example.py

Gobernanza de implementacion

  • Checklist de implementacion: ../../docs/F2-09-Microsoft-Agent-Framework-Implementation-Checklist.md
  • Checklist de review recurrente: ../../docs/F2-09-Microsoft-Agent-Framework-Integration-Review-Checklist.md
  • Matriz de paridad: ../../docs/F2-09-Microsoft-Agent-Framework-Parity-Matrix.md
  • Evaluacion de brecha de madurez: ../../docs/archive/F2-09-Microsoft-Agent-Framework-Maturity-Gap-Assessment.md
  • Documento de diseno: ../../docs/archive/F2-09-Microsoft-Agent-Framework-Integration-Design.md

CI dedicada

La validacion del paquete queda cubierta por .github/workflows/ci-microsoft-agent-framework.yml, con lint, type-check, tests, smoke runtime de workflow/orchestracion y build del paquete.

Conclusión

Para el alcance gobernado por F2-09, ya no queda una divergencia material abierta en runtime/orchestrations, observabilidad o recipes operativas. El siguiente trabajo natural pasa a ser mantenimiento incremental o extensiones no requeridas para la claim actual.

Metadata

Release files for agent-did-microsoft-agent-framework 1.0.0rc4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-did-microsoft-agent-framework 1.0.0rc4
File Size Uploaded Provenance Actions
agent_did_microsoft_agent_framework-1.0.0rc4.tar.gz 29.6 kB With provenance Details for agent_did_microsoft_agent_framework-1.0.0rc4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-did-microsoft-agent-framework 1.0.0rc4
File Interpreter ABI Platform Actions
agent_did_microsoft_agent_framework-1.0.0rc4-py3-none-any.whl Python 3 none any Details for agent_did_microsoft_agent_framework-1.0.0rc4-py3-none-any.whl

Total release size: 52.0 kB

Release files / agent_did_microsoft_agent_framework-1.0.0rc4.tar.gz

Download URL agent_did_microsoft_agent_framework-1.0.0rc4.tar.gz
Size 29.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a23e6fa262032755bdad1c8eab83c463d801ed32acf49e45840670eabaa8f5a9
BLAKE2b-256 checksum
How to use checksums
599b97e0d35dc4448f97485aa9700de8d2c58903fbda305b39fc3705584e34b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / agent_did_microsoft_agent_framework-1.0.0rc4-py3-none-any.whl

Download URL agent_did_microsoft_agent_framework-1.0.0rc4-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
477961f1873179a18ef075135d1ea8bdb5c8c13f3c5974ec992b53e6e87c670c
BLAKE2b-256 checksum
How to use checksums
6f2ab851e7185e0a3f91507adc647450820d05262239b78db0d04bdf1fc51e56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for agent-did-microsoft-agent-framework 1.0.0rc4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_did_microsoft_agent_framework-1.0.0rc4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page