Skip to main content

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.

PyPI License: MIT Python

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 to agent_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

Built and run in the EU. Your code and data never leave Europe.

License

MIT — see LICENSE.

Metadata

Release files for inis-agent-framework 0.1.1

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

Source distribution (sdist)

Source distribution for inis-agent-framework 0.1.1
File Size Uploaded
inis_agent_framework-0.1.1.tar.gz 13.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for inis-agent-framework 0.1.1
File Interpreter ABI Platform
inis_agent_framework-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / inis_agent_framework-0.1.1.tar.gz

Download URL inis_agent_framework-0.1.1.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0bdc0073e674492f1a6062269382607c1b8404cdf11bd4459552cfa19a63c265
BLAKE2b-256 checksum
How to use checksums
8b4a7d1cfeedc444dc627dba01699c336d583bc3a9fff6c2dd606b8f6a842502
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 8, 2026.

Transparency log

Release files / inis_agent_framework-0.1.1-py3-none-any.whl

Download URL inis_agent_framework-0.1.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4f68d1b93301d24cb89b1f8f4a2ffcea622ae4f3e716f98d80b0e2026525d0d
BLAKE2b-256 checksum
How to use checksums
994eb1c9c6e81980c4c59c6a3efa87406f5590951d9c5795ec22a47f958e0f54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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