inis.run CodeAct provider for Microsoft Agent Framework
Project description
inis-agent-framework
Native inis.run CodeAct provider for Microsoft Agent Framework (agent_framework.ContextProvider). Gives an Agent a real, isolated execute_code tool backed by inis.run's persistent Python interpreter.
CodeAct providers are a young, beta convention upstream. agent-framework-core itself is stable; Microsoft's own first-party CodeAct backends (agent-framework-monty, agent-framework-hyperlight) are each beta. Verified against agent-framework-core==1.13.0.
Install
pip install inis-agent-framework
Quickstart: attached (recommended)
One inis.run session for the whole conversation, owned by your app:
from inis import AsyncClient
from agent_framework import Agent
from inis_agent_framework import InisCodeActProvider
client = AsyncClient()
session = await client.sessions.create(egress_default="deny")
codeact = InisCodeActProvider.wrap(session)
agent = Agent(client=chat_client, name="assistant", context_providers=[codeact])
await agent.run("Use execute_code to compute 6 * 7.")
await session.destroy() # this app owns the session; the provider never will
Reconnect a later process to the same persistent interpreter context by session ID alone — no snapshot, no workspace round-trip:
codeact = InisCodeActProvider.attach("ses_abc123")
agent = Agent(client=chat_client, context_providers=[codeact])
await agent.run("What was x again?") # sees state from the earlier process
Owned: the provider creates and destroys the session for you
from inis_agent_framework import InisCodeActProvider
codeact = await InisCodeActProvider.create(egress_default="deny")
try:
agent = Agent(client=chat_client, context_providers=[codeact])
await agent.run("...")
finally:
await codeact.aclose() # destroys the session
Either way, only execute_code is model-visible.
Persistent interpreter state, not a fresh one per call
InisExecuteCodeTool runs through AsyncSession.run_code(), backed by a
real persistent Python process inside the session: a variable set in one
execute_code call is still there in the next one, across separate tool
calls and separate agent.run() invocations against the same session,
until restart_context() is called or the session is torn down.
What it does
execute_code(persistent Python interpreter) — text/image/table/json/error results mapped toagent_framework.Content- Interpreter state across calls and
agent.run()invocations —.attach()resumes the same context restart_context()— discards the interpreter context without touching the session's filesystem or lifecycle- Owned/attached lifecycle split —
.create()owns and destroys;.wrap()/.attach()never do
Notes
call_tool bridging to host-registered tools is not implemented, deliberately: inis.run's execute_code runs in a real remote VM with no channel for the guest to call an arbitrary host function mid-cell — that would let sandboxed code call any tool the agent has, unbounded. workspace_root/file_mounts (host-directory binding) is not implemented either: an inis.run session runs on separate hardware — there's no host directory to bind. Use session.read_file()/write_file() directly instead. .NET is out of scope: this package is Python-only, matching agent-framework-core's Python package. True remote cancellation of an in-flight execute_code call is not implemented — run_code() is timeout-only; a timeout_ms still ends the call and the interpreter context stays usable afterward.
Development
pip install -e ".[dev]"
pip install -e ../python # inis core SDK, editable
pytest
Links
- Docs: docs.inis.run
- Source: github.com/inis-run/sdk/tree/main/agent-framework
- Homepage: inis.run
Built and run in the EU. Your code and data never leave Europe.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inis_agent_framework-0.1.0.tar.gz.
File metadata
- Download URL: inis_agent_framework-0.1.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ea5c3d217061764c8e50a4fdb93f651003ad931cbad99002692a074d16733d6
|
|
| MD5 |
c737d9b73fc269b9150591ff27c40739
|
|
| BLAKE2b-256 |
c9315a9fe5bfe6d573d1d0965713de5211dd1e3e9900edaf54ff1965fd5ad767
|
Provenance
The following attestation bundles were made for inis_agent_framework-0.1.0.tar.gz:
Publisher:
sdk-agent-framework-publish.yml on 4ver/inis.run
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inis_agent_framework-0.1.0.tar.gz -
Subject digest:
9ea5c3d217061764c8e50a4fdb93f651003ad931cbad99002692a074d16733d6 - Sigstore transparency entry: 2312755176
- Sigstore integration time:
-
Permalink:
4ver/inis.run@be2853c14d1412460f1c3eccbad9e2149008edaf -
Branch / Tag:
refs/tags/agent-framework-v0.1.0 - Owner: https://github.com/4ver
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-agent-framework-publish.yml@be2853c14d1412460f1c3eccbad9e2149008edaf -
Trigger Event:
push
-
Statement type:
File details
Details for the file inis_agent_framework-0.1.0-py3-none-any.whl.
File metadata
- Download URL: inis_agent_framework-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
906663e4fe58c42e2693450fbda257af9b6c0cdc87fc07c3b242e6e2d0347fae
|
|
| MD5 |
4f1ff1cf25da3bfbcb41138001d65469
|
|
| BLAKE2b-256 |
e2ee955eb93cdfb307bf144fc4d0fc153259b632b00352cff5e0b530b0fd5683
|
Provenance
The following attestation bundles were made for inis_agent_framework-0.1.0-py3-none-any.whl:
Publisher:
sdk-agent-framework-publish.yml on 4ver/inis.run
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inis_agent_framework-0.1.0-py3-none-any.whl -
Subject digest:
906663e4fe58c42e2693450fbda257af9b6c0cdc87fc07c3b242e6e2d0347fae - Sigstore transparency entry: 2312755229
- Sigstore integration time:
-
Permalink:
4ver/inis.run@be2853c14d1412460f1c3eccbad9e2149008edaf -
Branch / Tag:
refs/tags/agent-framework-v0.1.0 - Owner: https://github.com/4ver
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-agent-framework-publish.yml@be2853c14d1412460f1c3eccbad9e2149008edaf -
Trigger Event:
push
-
Statement type: