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:
Agentcomo host principal coninstructions,tools,middlewareycontext_providers.tool(...)yFunctionToolcomo superficie nativa para exponer herramientas.AgentSessionpara continuidad conversacional sin exponer secretos en prompts.AgentExecutorcomo unidad reusable para orquestaciones.WorkflowBuilderyWorkflow.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:FunctionToolnativas de Agent Framework.get_current_identity()yget_current_document().get_tool(...)para resolver tools por nombre sin duplicar wiring manual.compose_instructions(...).create_agent_kwargs(...)para inyectarinstructionsytools.create_agent(...)para construir unAgentlisto para usar con el cliente del host.create_agent_executor(...)para adaptarlo a orquestaciones.create_function_executor(...)para reducers y handlers tipados compatibles confan-in.create_workflow_builder(...)ybuild_workflow_chain(...)para recipes y runtime coverage de workflows.build_fan_out_fan_in_workflow(...),build_multi_selection_workflow(...)ybuild_switch_case_workflow(...)para patrones avanzados del runtime.add_verified_handoff(...)sobre elWorkflowBuilderpara insertar verificacion de identidad en los bordes de handoff con TTL poraction_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_signaturedel 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. DevolverNonedetiene el workflow grasiosamente; devolver cualquier otro valor lo emite viactx.send_message(...)como salida del verificador.
Observabilidad:
agent_did.workflow.handoff_verifieden exitos (incluyefrom_did,action_class,ttl_seconds,decision_reason).agent_did.workflow.handoff_blockeden bloqueos (incluyefailing_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:
- Discusion original (handoff boundary vs middleware): microsoft/agent-framework#4842.
- Issue concreto con la API completa lockeada: edisonduran/agent-did#26.
- Race condition de key-rotation durante handoff: microsoft/agent-framework#4842 (comentario).
Tools expuestas por defecto
agent_did_get_current_identityagent_did_resolve_didagent_did_verify_signature
Tools opt-in
agent_did_sign_payloadagent_did_sign_http_requestagent_did_rotate_keyagent_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-selectionyswitch-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-outhacia ramas paralelasfan-ina un reductor finalmulti-selectionbasado en funcion de seleccionswitch-caseconCaseyDefault
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.refreshedagent_did.tool.startedagent_did.tool.succeededagent_did.tool.failedagent_did.workflow.executor_createdagent_did.workflow.function_executor_createdagent_did.workflow.builder_createdagent_did.workflow.chain_builtagent_did.workflow.fan_out_fan_in_builtagent_did.workflow.multi_selection_builtagent_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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.