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.0rc5 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,
)

El executor aguas arriba firma con sign_handoff(agent_identity=..., runtime_identity=..., payload=..., destination="<id del executor destino>") y emite el SignedHandoffMessage resultante. La firma cubre un sobre JSON canonico (RFC 8785) con payload (debe ser serializable a JSON), DID, key_id, signed_at, el id del executor destino y un nonce de un solo uso (build_handoff_envelope). El verificador reconstruye el sobre a partir del mensaje: un mensaje firmado para otro borde, con otro signed_at o con otro payload no verifica, y un par (did, nonce) se acepta una sola vez (nonce_store: por defecto en memoria de este verificador; pasa un store compartido si varias instancias verifican el mismo borde). signed_at no puede estar en el futuro mas alla de 30 s y un handoff de mas de 1 h se rechaza. allowed_dids es obligatorio para action_class="irreversible"; para las demas clases, omitirlo registra una advertencia porque el borde acepta cualquier DID que resuelva y firme.

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 no verifica contra el current key set y el mensaje trae key_id, se comprueba la llave contra el log did:webvh del DID en signed_at via verify_signature_at_time del SDK central (RFC-001 §6.2.2). Se acepta solo si el resultado es valid. signed_at lo declara el firmante, asi que una llave retirada despues de signed_at da indeterminate y el handoff se bloquea con failing_gates=["key_lifecycle"]: tras rotar su llave, el agente debe volver a firmar con la llave actual. Sin log did:webvh del DID en el cliente el resultado tambien es indeterminate (bloqueado).
  • 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:

Edad maxima y verificacion fresca en handoffs

  • La edad maxima de un mensaje depende de action_class (HANDOFF_MAX_AGE_DEFAULTS: 60 s irreversible, 600 s compensable, 3600 s reversible); add_verified_handoff(..., max_age_seconds=...) la baja, o la sube salvo en irreversible. El TTL por clase es solo la ventana de gracia para rotacion de clave.
  • Un salto irreversible o entre dominios descarta antes la resolucion en cache del emisor (evict_cached_resolution), asi que una clave retirada o un DID revocado dentro del TTL de la cache del resolver se detecta.
  • La firma cubre trust_domain.

Tools expuestas por defecto

  • agent_did_get_current_identity

Tools opt-in

agent_did_resolve_did y agent_did_verify_signature hacen que el modelo elija que DID resolver y, con un resolver HTTP, provocan peticiones salientes: desde 1.0.0-rc.5 son opt-in (resolve_did, verify_signatures). Al activarlas, limite los hosts del resolver con resolution_limits=ResolutionLimits(allowed_hosts=[...]).

  • agent_did_resolve_did
  • agent_did_verify_signature
  • 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.0rc5

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.0rc5
File Size Uploaded Provenance Actions
agent_did_microsoft_agent_framework-1.0.0rc5.tar.gz 38.8 kB With provenance Details for agent_did_microsoft_agent_framework-1.0.0rc5.tar.gz

Built distribution (wheel)

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

Total release size: 65.9 kB

Release files / agent_did_microsoft_agent_framework-1.0.0rc5.tar.gz

Download URL agent_did_microsoft_agent_framework-1.0.0rc5.tar.gz
Size 38.8 kB
Tags Source
SHA-256 checksum
How to use checksums
be65ce8224707667597aaba4421829471b7f0c9f02b5d3d920f8aff2f68aeead
BLAKE2b-256 checksum
How to use checksums
562b5f8c4a2516d305d9c380e7a6ba1c02e0e8b502c31d23e190f4f3932434b4
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 16, 2026.

Transparency log

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

Download URL agent_did_microsoft_agent_framework-1.0.0rc5-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7b3d0cd64ad5550a3a51cc7f73c450dad3275219a659bd125552bac34f7db1f
BLAKE2b-256 checksum
How to use checksums
5b0263bf0b3deea25af692affd3d12d6a6956a1c1d1417354b4a4dd57e791470
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 16, 2026.

Transparency log

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

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.0rc5.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 16, 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