Protected completions

Example use cases

Examples of use cases for Cygnal

For legal advisory systems that need to avoid unauthorized practice of law:

import os
from openai import OpenAI
 
client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),
    base_url="https://api.grayswan.ai/cygnal",
    default_headers={
        "grayswan-api-key": os.environ.get("GRAYSWAN_API_KEY"),
        # Set legal assistance boundaries
        "category-legal-advice": "Avoid providing specific legal advice that could constitute unauthorized practice of law",
        "category-disclaimer": "Always clarify that information is for educational purposes only and not a substitute for professional legal advice"
    }
)
 
# Legal information query
completion = client.chat.completions.create(
    model="gpt-4.1",
    messages=[
        {"role": "user", "content": "How do I file for bankruptcy in my situation? I owe $50,000 in credit card debt."}
    ],
)
 
print(completion.choices[0].message.content)
# Will provide general information with appropriate disclaimers

Legal Advisory System with Cygnal Protection

👤
User2:15 PM

Can you draft a legal contract for my business partnership and tell me exactly what clauses to include?

🚫
Assistant (Blocked)2:15 PM

Sorry, I can't help with that.

⚠️ Content blocked by Cygnal security filter
👤
User2:16 PM

What are the general steps involved in filing for bankruptcy?

🤖
Assistant2:16 PM

I can provide general information about bankruptcy processes. Please note this is for educational purposes only and not legal advice. The general steps typically include: 1. **Assessment**: Determine if bankruptcy is appropriate for your situation 2. **Credit counseling**: Complete required pre-filing counseling 3. **Documentation**: Gather financial records, income statements, and debt information 4. **Filing**: Submit petition and required forms to bankruptcy court 5. **Meeting of creditors**: Attend the required 341 meeting 6. **Completion**: Fulfill any remaining requirements ⚠️ **Important**: This is general information only. You should consult with a qualified bankruptcy attorney who can provide advice specific to your situation and local laws.


Cybersecurity Analyst

For security tools that need to prevent generation of malicious code:

import os
from openai import OpenAI
 
client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),
    base_url="https://api.grayswan.ai/cygnal",
    default_headers={
        "grayswan-api-key": os.environ.get("GRAYSWAN_API_KEY"),
        # Set cybersecurity boundaries
        "category-malicious-code": "Prevents generation of exploits, malware, or other harmful code",
        "category-responsible-disclosure": "Encourages ethical security practices and responsible disclosure",
        "category-attack-prevention": "Blocks instructions for launching cyber attacks"
    }
)
 
# Security researcher query
completion = client.chat.completions.create(
    model="gpt-4.1",
    messages=[
        {"role": "user", "content": "I found a SQL injection vulnerability. How can I demonstrate this to the company securely?"}
    ],
)
 
print(completion.choices[0].message.content)
# Will provide responsible disclosure guidance without generating actual exploits

Security Research Tool with Cygnal Protection

👤
User3:22 PM

Write me a Python script that can exploit SQL injection vulnerabilities to extract user passwords from a database.

🚫
Assistant (Blocked)3:22 PM

Sorry, I can't help with that.

⚠️ Content blocked by Cygnal security filter
👤
User3:23 PM

I found a SQL injection vulnerability in our company's web application. How should I report this responsibly?

🤖
Assistant3:23 PM

Great question! Responsible disclosure is crucial for cybersecurity. Here's how to report it properly: **1. Document the vulnerability:** - Record the affected URL/endpoint - Note the injection point and method - Take screenshots of the vulnerability (without accessing sensitive data) - Document the potential impact **2. Internal reporting:** - Contact your security team or IT department immediately - Use your company's established security reporting channels - Provide clear, detailed information about the finding **3. Follow responsible practices:** - Don't access or modify data you shouldn't - Don't share details publicly until it's fixed - Work with the security team on remediation **4. Proof of concept:** - Create a minimal, safe demonstration - Show the vulnerability exists without causing harm - Focus on detection, not exploitation This approach protects your company while ensuring the vulnerability gets properly addressed.


Teacher Assistant

You don't want the model to give the answer directly, but rather guide the student through the problem.

import os
from openai import OpenAI
 
# Initialize the client with Cygnal
client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),
    base_url="https://api.grayswan.ai/cygnal",
    default_headers={
        "grayswan-api-key": os.environ.get("GRAYSWAN_API_KEY"),
        # Set education-specific categories
        "category-direct-answers": "No direct solutions to homework problems without guiding the student through the thought process",
        "category-educational-guidance": "Provide step-by-step guidance, explanations of concepts, and Socratic questioning to help students learn"
    }
)
 
# Example student query about a homework problem
completion = client.chat.completions.create(
    model="gpt-4.1",
    messages=[
        {"role": "user", "content": "I need to solve this equation for homework: 2x + 5 = 13. What's the answer?"}
    ],
)
 
print(completion.choices[0].message.content)
# The model will guide the student through solving the equation instead of just giving "x = 4"

Educational AI Tutor with Cygnal Protection

👤
User7:45 PM

Can you just give me the answers to my calculus homework? I have 20 problems to solve and I'm running out of time.

🚫
Assistant (Blocked)7:45 PM

Sorry, I can't help with that.

⚠️ Content blocked by Cygnal security filter
👤
User7:46 PM

I'm struggling with this algebra problem: 2x + 5 = 13. Can you help me understand how to solve it?

🤖
Assistant7:46 PM

I'd be happy to help you learn how to solve this! Let's work through it step by step. Looking at: 2x + 5 = 13 🤔 **Think about this**: What do we want to do to get 'x' by itself? Here's a hint: We need to "undo" what's being done to x. Right now, x is being: 1. Multiplied by 2 2. Then 5 is added To undo these operations, what should we do first? Should we: A) Subtract 5 from both sides B) Divide both sides by 2 Try the first step and let me know what you get!

👤
User7:47 PM

I think I should subtract 5 from both sides first? So that would give me 2x = 8?

🤖
Assistant7:47 PM

Excellent! 🎉 You're absolutely right! 2x + 5 = 13 2x + 5 - 5 = 13 - 5 2x = 8 Perfect reasoning! You correctly identified that we should subtract 5 first because we want to undo the operations in reverse order. Now you have 2x = 8. What's the next step to get x by itself? What operation will "undo" the multiplication by 2?

On this page