For the complete documentation index, see llms.txt. This page is also available as Markdown.

Evaluate VibeSec Code Security Guidance

This guide demonstrates how VibeSec helps AI coding assistants generate more secure code by comparing implementations generated with Agent Guidelines disabled and enabled.

Use the same project, prompt, AI coding tool, and AI model throughout the evaluation to ensure a meaningful comparison.

Note: The examples in this document were generated using Claude Code v2.1.212 and Claude Opus 4.8. AI coding tools and models evolve frequently, so your results may differ depending on the tool, version, and model that you use.

Before you begin your VibeSec evaluation, check the installation and the Activity Log functioning.

Example 1: Prevent SSRF

In the following evaluation example, you will compare code generated with and without VibeSec Agent Guidelines.

Applying example 1 prompt when Agent Guidelines are DISABLED

  1. In the OX platform, go to Settings > VibeSec and disable Agent Guidelines.

  1. Run the prompt.

The destination URL is never validated.

Insecure code that was generated when VibeSec was disabled

The generated implementation sends requests directly to the user-provided URL.

Why the generated code is vulnerable

The caller supplies the destination URL, and an attacker could direct requests to:

  • localhost

  • private IP addresses

  • cloud metadata endpoints

  • internal services

This creates a Server-Side Request Forgery (SSRF) vulnerability.

Applying example 1 prompt when Agent Guidelines are ENABLED

  1. In the OX platform, go to Settings > VibeSec and enable Agent Guidelines.

  1. Run the prompt.

VibeSec identifies that the prompt could generate an SSRF vulnerability and injects the relevant organization security guidelines.

Important: Populate the allowlist with the trusted webhook domains used by your organization before deploying the implementation.

Secure code that was generated when VibeSec was enabled

The generated implementation:

  • Validates the URL scheme.

  • Restricts requests to HTTP and HTTPS.

  • Validates the destination hostname.

  • Uses a domain allowlist.

  • Configures request timeouts.

How VibeSec secured the code in example 1

Compared to the implementation generated without VibeSec, the AI:

  • Added URL validation.

  • Restricted requests to approved domains.

  • Added hostname validation.

  • Applied SSRF prevention techniques.

Example 2: Prevent insecure deserialization

In the following evaluation example, you will compare code generated with and without VibeSec Agent Guidelines.

Applying example 2 prompt when Agent Guidelines are DISABLED

  1. In the OX platform, go to Settings > VibeSec and disable Agent Guidelines.

  1. Run the prompt.

The AI model warns that loading pickle files may be unsafe but still generates code that uses:

The generated implementation remains vulnerable.

Insecure code that was generated when VibeSec was disabled

Why the generated code is vulnerable

Python's pickle format can execute arbitrary code during deserialization.

If the pickle file originates from an untrusted source, an attacker can craft a malicious file that executes arbitrary code when the application calls pickle.load().

Applying example 2 prompt when Agent Guidelines are ENABLED

  1. In the OX platform, go to Settings > VibeSec and enable Agent Guidelines.

  1. Run the prompt.

VibeSec injects the relevant organization security guidelines into the AI conversation before code generation.

Instead of:

the generated implementation uses:

Secure code that was generated when VibeSec was enabled

Before generating code, VibeSec identifies that the prompt could introduce Insecure Deserialization and Path Traversal vulnerabilities.

The generated implementation:

  • Uses JSON instead of pickle.

  • Validates the expected data structure.

  • Performs schema validation.

  • Explains why pickle.load() should not be used for untrusted input.

How VibeSec secured the code in example 2

Compared to the implementation generated without VibeSec, the AI:

  • Replaced pickle.load() with json.load().

  • Added schema validation.

  • Avoided insecure deserialization.

  • Explained why the safer implementation was chosen.

Last updated