-
Notifications
You must be signed in to change notification settings - Fork 0
AI Explain domain #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Introduces AI-powered advisory agents for architecture, dataflow, and secret confidence analysis, with opt-in consent and redaction for privacy. Adds new modules for AI engine, agent protocols, and feature-based architecture and dataflow scanning. Updates CLI to support AI features, integrates AI findings into scan results, and improves documentation on ethics and usage. Removes test_secret.py and adds cross-file test cases.
Added .DS_Store and memory_bank.md to .gitignore to prevent accidental commits of these miscellaneous files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces comprehensive AI-powered analysis capabilities to OpenAuditKit with a strong focus on privacy and ethics. The changes add optional AI agents for architecture review, threat modeling, data flow analysis, secret validation, and code explanation, while maintaining the tool's offline-first philosophy through opt-in consent mechanisms and data redaction.
Key Changes:
- Adds AI integration modules with ethics controls, consent management, and secret redaction
- Introduces five specialized AI agents for different security analysis tasks
- Updates CLI with new commands for AI configuration and code explanation
- Enhances documentation with AI usage guidelines and ethics policy
Reviewed changes
Copilot reviewed 38 out of 42 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| openaudit/ai/*.py | Core AI infrastructure including engine, models, protocol, and ethics/redaction utilities |
| openaudit/features/*/agent.py | Specialized AI agents for architecture, dataflow, threat modeling, secrets, and code explanation |
| openaudit/features/*/scanner.py | Scanners for architecture and dataflow analysis |
| openaudit/interface/cli/commands.py | Added AI flag to scan command and new explain command |
| openaudit/interface/cli/app.py | Registered new commands and config subcommands |
| openaudit/core/config.py | Configuration manager for API key storage |
| openaudit/core/domain.py | Added is_ai_generated field to Finding model |
| pyproject.toml | Added openai dependency and repository URLs |
| README.md | Updated with AI features, usage examples, and corrected installation instructions |
| AI_ETHICS.md | New document outlining AI privacy and ethics policies |
| .gitignore | Expanded to include consent files and standard Python patterns |
Critical Issues Found:
- Undefined
enginevariable in SecretConfidenceAgent causing runtime error - Debug print statements left in production code
- Typo in README documentation path
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - **Secure**: Secrets are masked in outputs; offline-first design. | ||
| - **Backend Ready**: Feature-based architecture with Pydantic models for easy integration into dashboards or APIs. | ||
| - **Customizable**: Add your own rules! See [Rule Documentation](rules/README.md). | ||
| - **Customizable**: Add your own rules! See [Rule Documentation](openopenaudit/rules/README.md). |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect path reference in documentation. The path 'openopenaudit/rules/README.md' contains a typo with doubled 'open'. Should be 'openaudit/rules/README.md'.
| - **Customizable**: Add your own rules! See [Rule Documentation](openopenaudit/rules/README.md). | |
| - **Customizable**: Add your own rules! See [Rule Documentation](openaudit/rules/README.md). |
| def run(self, context: PromptContext) -> AIResult: | ||
| from openaudit.ai.engine import AIEngine | ||
| if not engine.is_available(): | ||
| # No fallback, return None to indicate no analysis possible | ||
| return None |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing initialization of the AIEngine instance before calling is_available(). The 'engine' variable is used on line 14 but never declared in the run() method.
|
|
||
| import sys | ||
| def main(): | ||
| print(f"DEBUG: sys.argv = {sys.argv}") |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statement should be removed before merging to production. This line prints sys.argv on every execution which is not needed in production code.
| app.command(name="scan")(scan_command) | ||
| app.command(name="explain")(explain_command) | ||
| app.add_typer(config_app, name="config") | ||
| print(f"DEBUG: app in module {__name__} type: {type(app)}") |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statement should be removed before merging to production. This outputs internal app details on every run.
|
|
||
| def run(self, context: PromptContext) -> AIResult: | ||
| from openaudit.ai.engine import AIEngine | ||
| if not engine.is_available(): |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable 'engine' is undefined. It should be 'AIEngine()' initialized first, similar to other agent files.
| from openaudit.features.secrets.agent import SecretConfidenceAgent | ||
| from openaudit.features.secrets.agent import SecretConfidenceAgent |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate import statement on consecutive lines. Line 20 imports SecretConfidenceAgent which is already imported on line 19.
This pull request introduces major enhancements to OpenAuditKit, focusing on the integration of AI-powered analysis, improved documentation, and a strong emphasis on privacy and ethics. The changes add new modules for AI functionality, update documentation to reflect AI features and usage, and introduce mechanisms for user consent and data redaction. Additionally, new YAML rule sets for secrets and configuration scanning are provided, and installation/test instructions are clarified.
AI Integration & Privacy/Ethics
openaudit/ai/engine.py,openaudit/ai/models.py,openaudit/ai/ethics.py, and updatedopenaudit/ai/__init__.pyto provide AI analysis capabilities, prompt context modeling, and a redaction utility to mask secrets before sending code to LLMs. Also included a consent manager to ensure explicit user opt-in for AI features. [1] [2] [3] [4]AI_ETHICS.md, detailing opt-in requirements, data redaction, advisory nature of AI findings, support for local/external LLMs, and transparency of AI prompts.Documentation & Usage Improvements
README.mdandopenaudit.egg-info/PKG-INFOto document AI-powered features, usage demos, agent descriptions, and revised installation/testing instructions to usepip install openaudit,openaudit scan, and modern test commands. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Rule Sets
build/lib/openaudit/rules/secrets.yaml) and configuration/infrastructure scanning (build/lib/openaudit/rules/config.yaml), improving detection of common security issues and misconfigurations. [1] [2]CLI & Packaging Updates
__init__.pyand updated CLI entry points withopenaudit/__main__.pyandbuild/lib/openaudit/main.py, ensuring proper invocation and debugging support. [1] [2] [3] [4]openaifor AI features inopenaudit.egg-info/requires.txtandPKG-INFO. [1] [2]These changes collectively provide robust AI-powered analysis while maintaining a strong commitment to user privacy and transparency.