Skip to content

Latest commit

History

History
85 lines (62 loc) · 2.12 KB

File metadata and controls

85 lines (62 loc) · 2.12 KB
titleQuickstart
last_reviewed2026-07-12
ownerdocs-team

Quickstart

Use a native ACS manifest for policy and an Agent OS adapter for framework lifecycle mediation.

Install

pip install agent-governance-toolkit[full]

Create a starter bundle

python -m agent_os.cli.cmd_policy_gen \
--template strict \
--output policies/
agt lint-policy policies/manifest.yaml

The generated directory contains manifest.yaml and policy.rego. The manifest binds the Rego policy to native intervention points.

Evaluate a tool call

fromagent_control_specificationimportAgentControl, HostSessionruntime=AgentControl.from_path("policies/manifest.yaml")
session=HostSession(
runtime,
agent_id="quickstart-agent",
session_id="quickstart-session",
)
evaluation=session.pre_tool_call(
tool_name="delete_file",
args={"path": "report.txt"},
)
print(evaluation.verdict)
print(evaluation.reason_code)

Attempted tool calls are charged before evaluation, including denied attempts. The runtime itself remains free of session counters.

Attach a framework

fromagent_os.integrations.langchain_adapterimportLangChainKernelkernel=LangChainKernel(runtime=runtime)

Every supported adapter receives the native runtime through runtime=. Policy definitions, blocked content, tool catalogs, budgets, transforms, and approval belong in the manifest rather than the adapter constructor.

Handle a denial

fromagent_os.exceptionsimportPolicyViolationErrorifnotevaluation.verdict.decision.permits:
error=PolicyViolationError.from_evaluation_result(evaluation)
print(str(error))
print(error.evaluation_result.audit_record())

The public exception text is sanitized. Trusted code can use the attached PolicyEvaluation for structured audit and dispatch.

Next steps