Quick Start
Get your first detection running in under 5 minutes.
2. Install the Python library
pip install instructeerSource and full docs: github.com/Instructeer/instructeer-python
3. Scan text for PII
Send any free-form text to PIIGuard. All 13 detectors run in one request.
from instructeer.guards import PIIGuard
# api_key = os.environ["INSTRUCTEER_API_KEY"]
pii = PIIGuard(api_key="rg_your_key")
result = pii.detect_all("Contact John Smith at john@example.com or 555-867-5309")
print(result.summary.total, result.summary.max_severity){
"detections": [
{ "entity_type": "PERSON", "value": "John Smith", "confidence": 1.0, "severity": "high" },
{ "entity_type": "EMAIL_ADDRESS", "value": "john@example.com", "confidence": 1.0, "severity": "medium" },
{ "entity_type": "PHONE_NUMBER", "value": "555-867-5309", "confidence": 0.5, "severity": "medium" }
]
}Or run a single detector — useful when you only care about one entity type.
result = pii.detect_card("Charged to 4111 1111 1111 1111")
print(result.detections[0].value) # "4111 1111 1111 1111"4. Analyze a SQL query
Send any SQL query to SQLGuard before it runs against your database.
from instructeer.guards import SQLGuard
sql = SQLGuard()
result = sql.analyze("DELETE FROM users", dialect="postgres")
if not result.allowed:
raise ValueError(f"Query blocked: {result.severity}"){
"allowed": false,
"severity": "high",
"issues": [
{ "rule": "dml_no_where", "severity": "high", "message": "DELETE without WHERE clause would affect all rows" }
]
}5. Use in your application
Scan LLM input before it reaches the model. Scan LLM output before it reaches the user or runs against your database.
from instructeer.guards import SQLGuard, PIIGuard
pii = PIIGuard()
sql = SQLGuard()
user_input = "What happened to John Smith, SSN 123-45-6789?"
if pii.detect_all(user_input).summary.total > 0:
raise ValueError("PII detected in input")
generated_sql = "SELECT * FROM users"
if not sql.analyze(generated_sql).allowed:
raise ValueError("Unsafe query blocked")