Skip to main content

Ghemud AgentKit

A secure, provider-agnostic runtime for AI agents to discover and execute tools — with explicit permissions, budgets, retries, approvals, and a tamper-evident audit trail.

Created and maintained by Yashraj Sachin Ghemud, Ghemud AgentKit is the runtime boundary between an AI agent decision and a real-world side effect. It validates model output as untrusted input, checks capabilities before execution, and records an observable, bounded, auditable invocation lifecycle.

Built for Python developers who need secure AI-agent tool execution. Ghemud AgentKit brings permissions, approvals, budgets, retries, redaction, and auditability into a provider-agnostic runtime.

from ghemud_agentkit import ToolRegistry, ToolRuntime, tool

@tool(description="Add two integers")
def add(a: int, b: int) -> int:
    """Add a and b."""
    return a + b

registry = ToolRegistry()
registry.register(add)
runtime = ToolRuntime(registry)   # conservative defaults

result = await runtime.run("add", {"a": 2, "b": 3})
assert result.content == 5

Why Ghemud AgentKit

Without a runtime boundary With Ghemud AgentKit
Model output trusted as function calls Model output validated against JSON Schema with size/depth limits
"The agent has access to everything" Capability-based permissions: allow / deny / human-approval, evaluated before side effects
Unbounded tool loops Time, cost, and tool-call budgets with atomic reservation
Secrets sprayed through logs Mandatory redaction in every event, audit record, and model-visible result
No answer to "who approved what, when" Hash-chained (optionally HMAC-signed) audit trail
Untestable without a provider API key Deterministic fake models; zero network in the entire test suite

The 30-second tour

import asyncio
from ghemud_agentkit import (
    AgentLoop, LoopConfig, ScriptedModel,
    ToolRegistry, ToolRuntime, tool,
)
from ghemud_agentkit.models import tool_call, text_response

registry = ToolRegistry()
# ... register tools ...

runtime = ToolRuntime(registry)

# Deterministic loop with a scripted model (no API key, no network):
model = ScriptedModel([
    tool_call("add", {"a": 19, "b": 23}),   # 1) model calls a tool
    text_response("19 + 23 = 42"),           # 2) model answers
])
loop = AgentLoop(model, runtime, config=LoopConfig(max_iterations=5))
result = asyncio.run(loop.run("what is 19+23?"))
print(result.final_text)          # -> "19 + 23 = 42"
print(result.stop_reason)         # -> StopReason.COMPLETED

Swap ScriptedModel for the OpenAI adapter (pip install "ghemud-agentkit[openai]") and the same loop, policies, budgets, and audit trail run against a real provider.

What's in the box

  • Tool API — @tool decorator with schema inference from type hints (dataclasses, pydantic, Literal, enums, containers); sync and async tools; injected ctx: ToolContext for cancellation, state, and deadlines.
  • Registries — namespaced, composite (first-match-wins with conflict detection), immutable snapshots, capability discovery.
  • Invocation lifecycle — validated state machine (requested → validated → authorized → [approval] → queued → running → terminal) with structured events at every transition under one stable invocation ID.
  • Permissions — capability-based policies with deny > approval > allow precedence, risk tiers, and a conservative DefaultPolicy.
  • Human approval — TTL'd approval requests and TTL'd decisions; auto-deny for non-interactive environments; pluggable providers (console, callback, static).
  • Resilience — bounded exponential backoff with jitter; retries only for idempotent/retryable tools; failure classification (validation/policy/approval/timeout/transient/application/…).
  • Budgets — time, cost, and tool-call ceilings with atomic reserve/commit/release; budget state never leaks into error messages.
  • Observability — typed event bus, in-memory collectors, mandatory secret redaction, debug events opt-in.
  • Audit — hash-chained records (args digested from the redacted view), optional HMAC signing, JSONL file sink, chain verification API.
  • Agent loop — model ↔ tools alternation with parallel tool calls, deterministic ordering, and eight explicit stop conditions.
  • CLI — list, inspect, validate-policy, run --dry-run, trace.
  • Interop — MCP adapter (optional extra); discovery schemas are byte-identical to enforcement schemas.

Installation

pip install ghemud-agentkit            # core, zero required dependencies
pip install "ghemud-agentkit[openai]"  # + OpenAI adapter
pip install "ghemud-agentkit[mcp]"     # + MCP interop

Python 3.10+ · Apache-2.0.

Documentation

Compatibility policy

Semantic versioning. The public API is from ghemud_agentkit import ... plus stable submodules; anything documented in this README is covered. Internals (underscore-prefixed modules and names) may change at any patch release.

Author, citation, and contribution

Ghemud AgentKit was created by Yashraj Sachin Ghemud. Use the metadata in CITATION.cff when citing this software, review CREDITS.md for project attribution, and see CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md before participating or reporting a vulnerability.


Ghemud AgentKit treats model output as adversarial input even when the application trusts the model. If you remember one thing about this library, remember that.

Metadata

Release files for ghemud-agentkit 0.1.0

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

Source distribution (sdist)

Source distribution for ghemud-agentkit 0.1.0
File Size Uploaded Provenance Actions
ghemud_agentkit-0.1.0.tar.gz 141.5 kB Without provenance Details for ghemud_agentkit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ghemud-agentkit 0.1.0
File Interpreter ABI Platform Actions
ghemud_agentkit-0.1.0-py3-none-any.whl Python 3 none any Details for ghemud_agentkit-0.1.0-py3-none-any.whl

Total release size: 258.2 kB

Release files / ghemud_agentkit-0.1.0.tar.gz

Download URL ghemud_agentkit-0.1.0.tar.gz
Size 141.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5fe3fdba37c06ce89880a0b996653d2dd8b58a3a2cf6c9cfed557c418ef79787
BLAKE2b-256 checksum
How to use checksums
e14f8276aecf6ac4b8276509f173ae1a38991d478e5f97e2fa46c6081c5be108
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / ghemud_agentkit-0.1.0-py3-none-any.whl

Download URL ghemud_agentkit-0.1.0-py3-none-any.whl
Size 116.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f69c50dc086e714162e300c86a7e9ac746a671cf6a4820ad4f3ca294564d65f
BLAKE2b-256 checksum
How to use checksums
711659b376b57d08fb6539ba93e79d3a3ae3f095c1a261a5da8daf0b8376b0b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for ghemud-agentkit 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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