{"id":29646275,"url":"https://github.com/viniciusfinger/bedrock-guardrail-validator","last_synced_at":"2025-07-22T02:11:29.163Z","repository":{"id":301175524,"uuid":"1008371306","full_name":"viniciusfinger/bedrock-guardrail-validator","owner":"viniciusfinger","description":"Validate the effectiveness of Amazon Bedrock guardrails automatically. This project runs tests from a ground truth set of messages, compares the expected results with those filtered by the guardrail, and generates a detailed PDF report.","archived":false,"fork":false,"pushed_at":"2025-06-25T14:09:18.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-21T15:26:47.175Z","etag":null,"topics":["artificial-intelligence","aws","aws-bedrock","generative-ai","guardrails","llm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viniciusfinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-25T12:47:16.000Z","updated_at":"2025-07-15T00:58:33.000Z","dependencies_parsed_at":"2025-06-25T15:01:44.279Z","dependency_job_id":null,"html_url":"https://github.com/viniciusfinger/bedrock-guardrail-validator","commit_stats":null,"previous_names":["viniciusfinger/bedrock-guardrail-validator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/viniciusfinger/bedrock-guardrail-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusfinger%2Fbedrock-guardrail-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusfinger%2Fbedrock-guardrail-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusfinger%2Fbedrock-guardrail-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusfinger%2Fbedrock-guardrail-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viniciusfinger","download_url":"https://codeload.github.com/viniciusfinger/bedrock-guardrail-validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusfinger%2Fbedrock-guardrail-validator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266411608,"owners_count":23924346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["artificial-intelligence","aws","aws-bedrock","generative-ai","guardrails","llm"],"created_at":"2025-07-22T02:11:28.664Z","updated_at":"2025-07-22T02:11:29.156Z","avatar_url":"https://github.com/viniciusfinger.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bedrock Guardrail Validator ✅🛡️\n\nValidate the effectiveness of Amazon Bedrock guardrails automatically. This project runs tests from a ground truth set of messages, compares the expected results with those filtered by the guardrail, and generates a detailed PDF report.\n\n## Features\n\n- **Automated guardrail validation**: Test if the guardrail is correctly filtering sensitive messages.\n- **PDF report**: Automatically generates a report with accuracy metrics and error examples.\n- **Easy setup**: Just fill in a JSON file with your test cases.\n\n## Prerequisites\n\n- **Python 3.8+**\n- **Configured AWS credentials** (for Bedrock access)\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/viniciusfinger/bedrock-guardrail-validator\n   cd bedrock-guardrail-validator\n   ```\n2. Install the dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\n1. **Fill in the `ground_truth.json` file**\n\n   Create a file named `ground_truth.json` in the project root with the following format:\n   ```json\n   [\n     {\n       \"message\": \"Text to be tested\",\n       \"should_filter\": true\n     },\n     {\n       \"message\": \"Another safe text\",\n       \"should_filter\": false\n     }\n     // ... more test cases\n   ]\n   ```\n   - `message`: The text that will be sent to the guardrail.\n   - `should_filter`: `true` if the text should be blocked/intervened by the guardrail, `false` otherwise.\n\n2. **Configure the Guardrail**\n\n   In the `main.py` file, set the variables:\n   - `GUARDRAIL_ID`: The ID of the guardrail to be tested.\n   - `GUARDRAIL_VERSION`: The guardrail version (e.g., \"DRAFT\" or a version number).\n\n3. **Run the validator**\n   \n   ```bash\n   python main.py\n   ```\n   The script will:\n   - Process all cases from `ground_truth.json`.\n   - Generate an `output.json` file with the results.\n   - Generate a PDF report named `guardrail_report.pdf`.\n\n## Generated Report\n\nThe PDF report includes:\n- Total processed entries\n- Number of correct guardrail hits\n- Accuracy (%)\n- Table with examples of messages that were not filtered correctly\n\n## Customization\n\n- You can modify the script to adapt the evaluation logic, input or output formats as needed.\n- The report can be customized by editing the `report.py` file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciusfinger%2Fbedrock-guardrail-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviniciusfinger%2Fbedrock-guardrail-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciusfinger%2Fbedrock-guardrail-validator/lists"}