Installing the toolkit, and the name it imports under
One pip command, and then a surprise about what to import. This lesson installs the stack and finds out what is actually in it.
The toolkit is published by Microsoft on PyPI under the MIT licence. The base package is an installer and a handful of static checks; the runtime governance lives in companion distributions that come in through an extra.
pip install "agent-governance-toolkit[full]==4.1.0"Pin the version. This is a public preview and the APIs move between releases; every output in this course came from 4.1.0.
The name it imports under
The obvious import does not work, and the error says nothing useful about why.
try:
import agent_governance_toolkit
except ModuleNotFoundError as exc:
print("no:", exc)
import agent_compliance
print("yes:", agent_compliance.__name__)The distribution is called agent-governance-toolkit but the module it installs is agent_compliance. The package was published as ai-agent-compliance before it was renamed, and the import name never followed.
agent_compliance.__version__ reports 3.2.2 on the 4.1.0 release, so never use it to decide what your code can rely on. pip show agent-governance-toolkit tells the truth.What the extra brought in
The [full] extra pulls three more distributions. The runtime governance this course is about lives in the core one, under names of its own.
import agent_control_plane, agent_os, agentmesh, agent_sandbox
for module in (agent_control_plane, agent_os, agentmesh, agent_sandbox):
print(module.__name__)agent_control_plane holds the kernel and the policy engine and is where this course spends most of its time. agent_os carries the declarative policy files of part 3. agentmesh is identity, and agent_sandbox is execution isolation.
Importing agent_os prints a deprecation warning telling you to use agent-governance-toolkit-core. That is the distribution name you already installed, and the module keeps working; it is the package consolidation talking, not a broken install.
| Distribution | Module | What is in it |
|---|---|---|
| agent-governance-toolkit | agent_compliance | Installer, linting, supply chain checks |
| agent-governance-toolkit-core | agent_control_plane | The kernel and the policy engine |
| agent-governance-toolkit-core | agent_os | Declarative policy files |
| agent-governance-toolkit-core | agentmesh | Identity, trust and delegation |
| agent-governance-toolkit-cli | agent_sandbox | Sandbox providers |
- Run
pip show agent-governance-toolkitand compare the version withagent_compliance.__version__. - Import
agent_oson its own and read the deprecation warning in full. - Try
import agent_control_specification, which is the newest policy layer and is not in the pip install at all. Lesson 29 says what it needs.
Slow is fine. Stopping is the only problem.