{"id":41785511,"url":"https://github.com/tzervas/aphelion-agent-security-framework","last_synced_at":"2026-01-25T04:12:02.021Z","repository":{"id":298787492,"uuid":"1001086087","full_name":"tzervas/aphelion-agent-security-framework","owner":"tzervas","description":"A lightweight, modular security framework for AI/ML models, agents, tools, and data, targeting Google ADK, Anthropic MCP, and extensible protocols that emphasizes ease of use, zero-trust security, and flexible deployment.","archived":false,"fork":false,"pushed_at":"2025-06-26T15:19:02.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T15:28:26.031Z","etag":null,"topics":["agents","extension","framework","google-adk","mcp-python-sdk","model-context-protocol","python-3-12","security","tool-call-hardening","tool-calls","zero-trust"],"latest_commit_sha":null,"homepage":"","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/tzervas.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}},"created_at":"2025-06-12T19:52:37.000Z","updated_at":"2025-06-26T15:19:03.000Z","dependencies_parsed_at":"2025-06-12T23:36:26.469Z","dependency_job_id":"f2d7d61d-3a5e-47fb-a617-d45dcdd2efd4","html_url":"https://github.com/tzervas/aphelion-agent-security-framework","commit_stats":null,"previous_names":["tzervas/aphelion-agent-security-framework"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tzervas/aphelion-agent-security-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faphelion-agent-security-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faphelion-agent-security-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faphelion-agent-security-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faphelion-agent-security-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tzervas","download_url":"https://codeload.github.com/tzervas/aphelion-agent-security-framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faphelion-agent-security-framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28742983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T02:46:29.005Z","status":"ssl_error","status_checked_at":"2026-01-25T02:44:29.968Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["agents","extension","framework","google-adk","mcp-python-sdk","model-context-protocol","python-3-12","security","tool-call-hardening","tool-calls","zero-trust"],"created_at":"2026-01-25T04:12:01.971Z","updated_at":"2026-01-25T04:12:02.016Z","avatar_url":"https://github.com/tzervas.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aphelion Agent Security Framework\n\n🚀 **Project Status**: In active development. All components subject to change. Contributions and feedback welcome.\n\n🎯 **Intent**: Simplify and strengthen security for AI agents, tool interactions, and data access across workflows and environments. Provide a lightweight, user-friendly solution for hobbyists, small businesses, and enterprises.\n\n🛠️ **Goals**:\n- Simplify Integration\n- Enhance Security\n- Broad Applicability\n- Configurability\n- Performance\n- Scalability\n\n## Table of Contents\n\n1. [Description](#description)\n2. [Installation](#installation)\n3. [Usage](#usage)\n   - [Basic Example](#basic-example)\n   - [Advanced Usage](#advanced-usage)\n4. [Features](#features)\n5. [Configuration](#configuration)\n6. [Testing](#testing)\n7. [Development Setup](#development-setup)\n8. [Proposed Implementation](#proposed-implementation)\n   - [Proof of Concept (POC)](#proof-of-concept-poc)\n   - [Minimum Viable Product (MVP)](#minimum-viable-product-mvp)\n9. [Security Best Practices](#security-best-practices)\n10. [Contribution](#contribution)\n11. [License](#license)\n12. [Contact](#contact)\n13. [Troubleshooting](#troubleshooting)\n14. [Acknowledgments](#acknowledgments)\n15. [References](#references)\n\n## Description\n\nA lightweight, modular security framework for AI/ML models, agents, tools, and data, targeting Google ADK, Anthropic MCP, and extensible protocols that emphasizes ease of use, zero-trust security, and flexible deployment.\n\n## Installation\n\nTo install the Aphelion Agent Security Framework, use pip:\n\n```bash\npip install git+https://github.com/tzervas/aphelion-agent-security-framework.git@main\n```\n\nFor development, we recommend using [UV](https://docs.astral.sh/uv/) for managing dependencies. See the [Development Setup](#development-setup) section for more details.\n\n## Usage\n\n### Basic Example\n\nHere’s a simple example of how to use the framework:\n\n```python\nfrom aphelion import SecurityFramework\n\n# Initialize the framework\nframework = SecurityFramework(config_path=\"config.yaml\")\n\n# Authenticate a user\nuser = framework.authenticate(token=\"valid_token\")\n\n# Authorize an action\nif framework.authorize(user, action=\"call_tool\", resource=\"tool1\"):\n    result = framework.dispatch(protocol=\"MCP\", action=\"call_tool\", resource=\"tool1\")\n    print(result)\nelse:\n    print(\"Access denied\")\n```\n\n### Advanced Usage\n\nFor more advanced usage, including FastAPI integration, refer to the [Proposed Implementation](#proposed-implementation) section.\n\n## Features\n\n- Unified security interface for MCP and ADK\n- Zero-trust authentication and authorization\n- Dynamic RBAC/ABAC policies\n- Data encryption and input validation\n- Comprehensive logging and monitoring\n- Flexible deployment options (Docker, Kubernetes, etc.)\n\n## Configuration\n\nThe framework can be configured using a YAML file or environment variables. Example `config.yaml`:\n\n```yaml\nauthentication:\n  jwt_secret: \"your_secret_key\"\nauthorization:\n  model_file: \"rbac_model.conf\"\n  policy_file: \"rbac_policy.csv\"\nlogging:\n  level: \"INFO\"\n  file: \"security.log\"\n```\n\nFor a full list of options, see the [Configuration Guide](docs/configuration.md). \u003c!-- Assuming such a guide exists --\u003e\n\n## Testing\n\nTo run the tests, use:\n\n```bash\npytest\n```\n\nEnsure development dependencies are installed. See the [Development Setup](#development-setup) section.\n---\n\n## Development Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/tzervas/aphelion-agent-security-framework.git\n   ```\n2. Navigate to the project directory:\n   ```bash\n   cd aphelion-agent-security-framework\n   ```\n3. Use [UV](https://docs.astral.sh/uv/) to install dependencies:\n   ```bash\n   uv sync\n   ```\n4. Configure the framework by updating `config.yaml` or setting environment variables.\n5. Run the application:\n   ```bash\n   python main.py\n   ```\n   or use Docker:\n   ```bash\n   docker-compose up\n   ```\n\n---\n\n## Proposed Implementation\n\n### Proof of Concept (POC)\n\nDemonstrates core security concepts in a simplified form.\n\n```python\nimport jwt\nfrom casbin import Enforcer\nfrom anthropic import Anthropic  # Hypothetical MCP client\nfrom google.adk.agents import Agent  # Hypothetical ADK client\n\nenforcer = Enforcer(\"rbac_model.conf\", \"rbac_policy.csv\")\n\ndef authenticate(token):\n    return jwt.decode(token, \"secret\", algorithms=[\"HS256\"])[\"sub\"]\n\ndef authorize(subject, action, resource):\n    return enforcer.enforce(subject, action, resource)\n\ndef handle_request(protocol, token, action, resource):\n    subject = authenticate(token)\n    if authorize(subject, action, resource):\n        if protocol == \"MCP\":\n            return Anthropic().call_tool(action, resource)\n        elif protocol == \"ADK\":\n            return Agent().call_tool(action, resource)\n    raise PermissionError(\"Access denied\")\n\n# Test\nrequest = {\"protocol\": \"MCP\", \"token\": \"valid_token\", \"action\": \"call_tool\", \"resource\": \"tool1\"}\nresult = handle_request(**request)\nprint(result)\n```\n\n### Minimum Viable Product (MVP)\n\nRobust, configurable, and deployment-ready for go-to-market.\n\n```python\nfrom fastapi import FastAPI, HTTPException\nfrom casbin import Enforcer\nfrom jwt import decode\nfrom pydantic import BaseModel\nfrom anthropic import Anthropic\nfrom google.adk.agents import Agent\nimport logging\n\napp = FastAPI()\nenforcer = Enforcer(\"rbac_model.conf\", \"rbac_policy.csv\")\nlogging.basicConfig(level=logging.INFO)\n\nclass Request(BaseModel):\n    token: str\n    action: str\n    resource: str\n\ndef authenticate(token):\n    return decode(token, \"secret\", algorithms=[\"HS256\"])[\"sub\"]\n\n@app.post(\"/mcp/call_tool\")\nasync def mcp_call(request: Request):\n    subject = authenticate(request.token)\n    if enforcer.enforce(subject, request.action, request.resource):\n        result = Anthropic().call_tool(request.action, request.resource)\n        logging.info(f\"Allowed: {subject} -\u003e {request.action} on {request.resource}\")\n        return {\"result\": result}\n    logging.warning(f\"Denied: {subject} -\u003e {request.action} on {request.resource}\")\n    raise HTTPException(403, \"Access denied\")\n\n@app.post(\"/adk/call_tool\")\nasync def adk_call(request: Request):\n    subject = authenticate(request.token)\n    if enforcer.enforce(subject, request.action, request.resource):\n        result = Agent().call_tool(request.action, request.resource)\n        logging.info(f\"Allowed: {subject} -\u003e {request.action} on {request.resource}\")\n        return {\"result\": result}\n    logging.warning(f\"Denied: {subject} -\u003e {request.action} on {request.resource}\")\n    raise HTTPException(403, \"Access denied\")\n```\n\n---\n\n## Security Best Practices\n\n🔒\n- **Zero-Trust**: Validate all requests with JWT and enforce least privilege.\n- **RBAC/ABAC**: Dynamic policies via `pycasbin` for fine-grained control.\n- **Encryption**: Use `cryptography` for sensitive data (configurable).\n- **Input Validation**: Prevent injection attacks with strict parsing.\n- **Logging**: Comprehensive audit trails with `logging` and Prometheus.\n- **Dependency Management**: Minimal, vetted dependencies with regular updates.\n- **Secure Defaults**: Enable encryption and strict policies by default.\n\n---\n\n## Contribution\n\nContributions are welcome! Please see the [Developer Guide](docs/developer_guide.md) and [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for more information.\n\n## Contact\n\n- **Author**: Tyler Zervas\n- **GitHub**: [tzervas](https://github.com/tzervas)\n- **X**: [@vec_wt_tech](https://x.com/vec_wt_tech)\n\n## Troubleshooting\n\nIf you encounter issues, check the [issue tracker](https://github.com/tzervas/aphelion-agent-security-framework/issues) or contact the author.\n\n## Acknowledgments\n\nSpecial thanks to the developers of [pycasbin](https://github.com/casbin/pycasbin), [pyjwt](https://github.com/jpadilla/pyjwt), and the Loguru library for their excellent tools.\n\n## References\n\n- [Google Python ADK GitHub Repo](https://github.com/google/adk-python)\n- [Anthropic MCP SDK](https://github.com/anthropics/anthropic-sdk-python)\n- [UV Documentation](https://docs.astral.sh/uv/)\n\nHappy Secure Agent Building!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzervas%2Faphelion-agent-security-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftzervas%2Faphelion-agent-security-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzervas%2Faphelion-agent-security-framework/lists"}