{"id":49585778,"url":"https://github.com/zeb-ai/z-grc","last_synced_at":"2026-05-03T22:35:07.326Z","repository":{"id":351858666,"uuid":"1203910857","full_name":"zeb-ai/z-grc","owner":"zeb-ai","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-02T17:09:46.000Z","size":933,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-02T17:22:33.696Z","etag":null,"topics":["claude-code","llm-governance","quota-management","token-control"],"latest_commit_sha":null,"homepage":"https://zeb-ai.github.io/z-grc/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeb-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-07T14:00:28.000Z","updated_at":"2026-05-02T17:09:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zeb-ai/z-grc","commit_stats":null,"previous_names":["zeb-ai/py-governance-engine","zeb-ai/z-grc"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/zeb-ai/z-grc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeb-ai%2Fz-grc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeb-ai%2Fz-grc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeb-ai%2Fz-grc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeb-ai%2Fz-grc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeb-ai","download_url":"https://codeload.github.com/zeb-ai/z-grc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeb-ai%2Fz-grc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32587821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","llm-governance","quota-management","token-control"],"created_at":"2026-05-03T22:35:06.652Z","updated_at":"2026-05-03T22:35:07.317Z","avatar_url":"https://github.com/zeb-ai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://readme-typing-svg.demolab.com?font=Fira+Code\u0026weight=700\u0026size=48\u0026duration=1\u0026pause=1000000\u0026color=6366F1\u0026center=true\u0026vCenter=true\u0026multiline=true\u0026repeat=false\u0026width=600\u0026height=120\u0026lines=Z-GRC\" alt=\"Z-GRC\"\u003e\n\u003c/p\u003e\n\n\u003ch2 align=\"center\"\u003e\u003cstrong\u003eGovernance, Risk, and Control Engine for LLMs\u003c/strong\u003e\u003c/h2\u003e\n\u003cp align=\"center\"\u003eBuilt by \u003ca href=\"https://zeb.ai\"\u003eZeb Labs\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://zeb-ai.github.io/z-grc-application/\"\u003e\u003cimg src=\"https://img.shields.io/badge/app_Z--GRC_Application-4F46E5?style=flat\" alt=\"Z-GRC Application\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/z-grc/\"\u003e\u003cimg src=\"https://img.shields.io/badge/PyPI-z--grc-FFD700?style=flat\u0026logo=pypi\u0026logoColor=white\" alt=\"PyPI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.python.org/downloads/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Python-3.14+-3776AB?style=flat\u0026logo=python\u0026logoColor=white\" alt=\"Python Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/astral-sh/ruff\"\u003e\u003cimg src=\"https://img.shields.io/badge/Code_Style-Ruff-000000?style=flat\u0026logo=ruff\u0026logoColor=white\" alt=\"Code Style: Ruff\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://zeb.ai\"\u003e\u003cimg src=\"https://img.shields.io/badge/Built_by-Zeb_Labs-blueviolet?style=flat\" alt=\"Built by Zeb Labs\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nEnterprise-grade governance engine for Large Language Model applications. Provides automatic interception, policy enforcement, quota management, and comprehensive observability across multiple LLM providers with zero code changes.\n\n## Installation\n\n```bash\nuv add z-grc\n```\n\nOr with auto-instrumentation:\n\n```bash\nuv add z-grc[auto-instrument]\n```\n\n## Quick Start\n\n```python\nimport zgrc\nimport boto3\nimport json\n\n# Initialize GRC\nzgrc.init(api_key=\"your-zgrc-api-key\")\n\n# Use your LLM SDK normally - GRC handles everything\nclient = boto3.client(\"bedrock-runtime\", region_name=\"us-east-1\")\n\nresponse = client.invoke_model(\n    modelId=\"us.anthropic.claude-sonnet-4-5-20250929-v1:0\",\n    body=json.dumps({\n        \"anthropic_version\": \"bedrock-2023-05-31\",\n        \"max_tokens\": 1024,\n        \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]\n    })\n)\n\n# Z-GRC automatically:\n# - Validates quota before requests\n# - Tracks token usage\n# - Enforces policies\n# - Sends telemetry (traces, metrics, logs)\n```\n\n## Features\n\n### Zero-Code Integration\nDrop-in solution requiring only `zgrc.init()`. Works with existing code without modifications.\n\n### Auto-Discovery\nAutomatically detects and intercepts installed LLM SDKs:\n- AWS Bedrock (boto3)\n- Anthropic (coming soon)\n- OpenAI (coming soon)\n- Azure OpenAI (coming soon)\n\n### Policy Enforcement\nReal-time quota validation and cost limit enforcement. Blocks requests when quota is exceeded.\n\n```python\nfrom zgrc.utils import QuotaExceededException\n\ntry:\n    response = client.invoke_model(...)\nexcept QuotaExceededException as e:\n    print(f\"Quota exceeded: ${e.used:.4f} used, ${e.remaining:.4f} remaining\")\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/quota-exceeded.png\" alt=\"Quota Exceeded Example\" width=\"600\"\u003e\n\u003c/p\u003e\n\n### Auto-Instrumentation\nOptional automatic instrumentation for HTTP clients, web frameworks, databases, and more:\n\n```python\nzgrc.init(\n    api_key=\"your-zgrc-api-key\",\n    auto_instrument=True,\n    app_name=\"my-app\",\n    environment=\"production\"\n)\n```\n\n### Framework Agnostic\nWorks with vanilla SDKs and popular frameworks:\n\n```python\n# PydanticAI\nfrom pydantic_ai import Agent\nagent = Agent(\"bedrock\")\nresult = await agent.run(\"Your prompt\")\n\n# LangChain\nfrom langchain_aws import ChatBedrock\nllm = ChatBedrock(model_id=\"...\")\nresponse = llm.invoke(\"Your prompt\")\n\n# Strands Agents\nfrom strands_agents import Agent\nagent = Agent(provider=\"bedrock\")\nresponse = agent.execute(\"Your prompt\")\n```\n\n### Streaming Support\nFully supports streaming responses with automatic token tracking:\n\n```python\nresponse = client.converse_stream(\n    modelId=\"...\",\n    messages=[{\"role\": \"user\", \"content\": [{\"text\": \"Tell me a story\"}]}]\n)\n\nfor event in response[\"stream\"]:\n    if \"contentBlockDelta\" in event:\n        print(event[\"contentBlockDelta\"][\"delta\"][\"text\"], end=\"\")\n```\n\n## Configuration\n\n```python\nzgrc.init(\n    api_key: str,                  # Your Z-GRC API key (required)\n    auto_instrument: bool = False, # Enable auto-instrumentation\n    app_name: str = None,          # Application name for telemetry\n    environment: str = None,       # Environment (dev/staging/prod)\n    log_level: int = logging.ERROR # Z-GRC internal log level\n)\n```\n\n## Proxy Mode (Claude Code CLI)\n\nFor environments where code modification isn't possible (like Claude Code CLI), use the standalone proxy:\n\n### Quick Start\n\n**Background Mode (Recommended):**\n\nIn the same terminal, run both commands:\n\n```bash\n# Step 1: Start proxy in background and set environment variables\neval $(z-grc-proxy --api-key=your-key -d)\n\n# Step 2: Run Claude Code in the same terminal\nclaude\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/proxy-running.png\" alt=\"Claude Code Running with Z-GRC Proxy\" width=\"600\"\u003e\n  \u003cbr\u003e\n  \u003cem\u003eClaude Code running with Z-GRC proxy in background mode\u003c/em\u003e\n\u003c/p\u003e\n\n\u003e **Note:** You need to run the `eval $(z-grc-proxy ...)` command in every new terminal where you want to use Claude Code with Z-GRC. The environment variables only apply to the current terminal session.\n\n**Foreground Mode:**\n\n**Terminal 1** - Start the proxy (shows logs):\n```bash\nz-grc-proxy --api-key=your-key\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/proxy-foreground.png\" alt=\"Z-GRC Proxy Running in Foreground\" width=\"600\"\u003e\n  \u003cbr\u003e\n  \u003cem\u003eProxy server running in foreground with request logs\u003c/em\u003e\n\u003c/p\u003e\n\n**Terminal 2** - Open another tab, set environment variables, and run Claude:\n```bash\nexport HTTPS_PROXY=http://127.0.0.1:8080\nexport NODE_EXTRA_CA_CERTS=~/.mitmproxy/mitmproxy-ca-cert.pem\nclaude\n```\n\n\u003e **Note:** In foreground mode, the proxy runs in Terminal 1 and shows live logs. Claude Code runs in Terminal 2 with the environment variables set to use the proxy.\n\n### Proxy Commands\n\n```bash\n# Start in background (auto port detection)\neval $(z-grc-proxy --api-key=your-key -d)\n\n# Start on specific port\neval $(z-grc-proxy --api-key=your-key --port=8085 -d)\n\n# Check active proxy sessions\nz-grc-proxy --status\n\n# Kill all proxy servers\nz-grc-proxy --kill-all\n\n# Verbose logging\neval $(z-grc-proxy --api-key=your-key -d --verbose)\n```\n\n### How It Works\n\n1. **Automatic Port Detection**: Finds available port (8080-8090)\n2. **Session Management**: Reuses existing proxy for same API key\n3. **mitmproxy Certificates**: Auto-generated in `~/.mitmproxy/` on first run\n4. **Platform Independent**: Works on macOS, Linux, Windows\n\n### Building Executables\n\nBuild standalone proxy binary with PyInstaller:\n\n```bash\n# Current platform only\nmake grpc-proxy-build\n```\n\nOutput: `dist/z-grc-proxy`\n\n### Test Binary\n```bash\n# Background mode\neval $(./dist/z-grc-proxy --api-key=your-key -d)\n\n# Foreground mode\n./dist/z-grc-proxy --api-key=your-key\n```\n\n## Installing Executor\n\n### macOS / Linux\n```bash\ncurl -fsSL https://raw.githubusercontent.com/zeb-ai/z-grc/main/install.sh | bash\n```\n\n### Windows (PowerShell)\n```powershell\nirm https://raw.githubusercontent.com/zeb-ai/z-grc/main/install.ps1 | iex\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeb-ai%2Fz-grc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeb-ai%2Fz-grc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeb-ai%2Fz-grc/lists"}