Files
agent-framework/dotnet/samples/02-agents/AgentWithCodeAct
T
Ben Thomas c79f886dc3 .NET: Align Foundry sample environment variables and credentials. (#6422)
* dotnet: refresh Foundry sample guidance

Carry forward the still-relevant sample guidance and Foundry-specific documentation fixes from the old stacked sample migration work, adapted to the current repo layout and policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* dotnet: rename Foundry sample env vars

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* dotnet: remove persistent provider sample

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* dotnet: drop SAMPLE_GUIDELINES.md from this PR

Defer the guidelines doc and its cross-link to a follow-on PR to avoid broken-link failures in CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* dotnet: add DefaultAzureCredential warning to remaining samples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* dotnet: address PR review feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c79f886dc3 · 2026-06-11 17:26:00 +00:00
History
..

Agent Framework CodeAct (Hyperlight) Samples

These samples show how to enable an agent to write and execute code in a Hyperlight-backed sandbox via the CodeAct pattern. Guest code can be pure Python (interpreter mode) or orchestrate host-provided tools through call_tool(...) — all inside a secure sandbox with opt-in filesystem and network access.

Sample Description
Code interpreter Uses HyperlightCodeActProvider as a sandboxed Python interpreter with no host tools.
Tool-enabled CodeAct Registers provider-owned tools that guest code can orchestrate via call_tool(...), with an approval-required tool for sensitive actions.
Manual wiring Uses HyperlightExecuteCodeFunction directly as an agent tool when the sandbox configuration is fixed.

All samples require a Hyperlight Python guest module. Set HYPERLIGHT_PYTHON_GUEST_PATH to its absolute path before running.