ai-output-guard

v0.1.1 suspicious
5.0
Medium Risk

AI Output Safety Middleware — the seatbelt between LLMs and your systems

🤖 AI Analysis

Final verdict: SUSPICIOUS

The package shows signs of potential misuse due to obfuscation techniques and the possibility of credential handling, raising concerns about its integrity.

  • High obfuscation risk
  • Potential credential handling mechanisms
Per-check LLM notes
  • Network: Network calls are expected for packages that interact with APIs or external services.
  • Shell: No shell execution patterns were detected.
  • Obfuscation: The presence of subprocess.Popen and exec indicates potential for code execution which could be malicious.
  • Credentials: The provided snippet does not directly show credential harvesting but the context suggests it might be part of a validation mechanism.
  • Metadata: The maintainer has only one package, indicating a new or less active account which could be suspicious, but no other red flags are present.

📦 Package Quality Overall: Medium (5.8/10)

✦ High Test Suite 9.0

Test suite present — 15 test file(s) found

  • Test runner config found: pyproject.toml
  • Test runner config found: conftest.py
  • 15 test file(s) detected (e.g. conftest.py)
◈ Medium Documentation 7.0

Some documentation present

  • Documentation URL: "Documentation" -> https://github.com/Churman1113/ai-output-guard#readme
  • Detailed PyPI description (7361 chars)
○ Low Contributing Guide 2.0

No contributing guide or governance files found

  • No CONTRIBUTING, CODE_OF_CONDUCT, or governance files found
◈ Medium Type Annotations 5.0

Partial type annotation coverage

  • 159 type-annotated function signatures detected in source
◈ Medium Multiple Contributors 6.0

Limited contributor diversity

  • 2 unique contributor(s) across 9 commits in Churman1113/ai-output-guard
  • Two distinct contributors found

🔬 Heuristic Checks

Outbound Network Calls score 3.0

Found 2 network call pattern(s)

  • } self.client = httpx.AsyncClient(base_url=self.BASE_URL, headers=self.headers) async
  • imeout self._client = httpx.AsyncClient( timeout=httpx.Timeout(timeout), fol
Code Obfuscation score 6.0

Found 3 obfuscation pattern(s)

  • "subprocess.Popen", "exec(", "eval(", "Runtime.getRuntime().exec", ],
  • arts) == 2: mod = __import__(parts[0], fromlist=[parts[1]]) schema_obj = getattr(mod, parts[1]) guard
  • body_bytes = __import__("json").dumps(resp_body, ensure_ascii=False).encode("utf-8")
Shell / Subprocess Execution

No shell execution patterns detected

Credential Harvesting score 2.5

Found 1 credential access pattern(s)

  • sult = guard.validate('rm -rf /etc/passwd') assert result.level == GuardLevel.DENY def t
Typosquatting

No typosquatting candidates detected

Registered Email Domain

No author email provided

Suspicious Page Links

All external links appear legitimate

Git Repository History

Repository Churman1113/ai-output-guard appears legitimate

Maintainer History score 2.0

1 maintainer concern(s) found

  • Author "AI Output Guard Team" appears to have only 1 package on PyPI (new or inactive account)
Known CVE Vulnerabilities

No known vulnerabilities found in OSV database.

💡 AI App Starter Prompt

Use this prompt to build a project with ai-output-guard
Create a Python-based mini-application named 'SafeAIQuery' that acts as a middleware layer to ensure safe and controlled interaction between a user and an AI language model. The app will utilize the 'ai-output-guard' package to filter and sanitize the output from an AI model before it reaches the end-user, ensuring that the response adheres to predefined safety guidelines. This application aims to protect users from harmful, inappropriate, or sensitive content while still allowing for engaging and informative interactions.

Step-by-Step Guide:
1. Set up the project environment by installing necessary packages including 'ai-output-guard', 'transformers', and 'flask'.
2. Implement a Flask web server to handle HTTP requests from users.
3. Integrate an AI language model using the 'transformers' library, such as GPT-3 or any other suitable model.
4. Use 'ai-output-guard' to create a middleware function that processes the raw output from the AI model. This middleware should perform the following tasks:
   - Check for any explicit content.
   - Ensure no personal information is leaked.
   - Verify that the output does not contain harmful advice or instructions.
5. Develop a user interface where users can input their queries and receive sanitized responses from the AI model through the middleware.
6. Test the application thoroughly to ensure all safety checks are functioning correctly and that user experience remains positive.
7. Document the setup process, usage instructions, and potential improvements for future developers.

Suggested Features:
- Real-time filtering of user inputs to prevent malicious queries.
- Detailed logs of all interactions for auditing purposes.
- A feedback mechanism for users to report unsafe outputs.
- Integration with multiple AI models for versatility.