perplexity-security-basics

Featured

Apply Perplexity security best practices for API key management and query safety. Use when securing API keys, implementing query sanitization, or auditing Perplexity security configuration. Trigger with phrases like "perplexity security", "perplexity secrets", "secure perplexity", "perplexity API key security", "perplexity PII".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Perplexity Security Basics ## Overview Security best practices for Perplexity Sonar API. Key concerns: API key protection (keys start with `pplx-`), query sanitization (Perplexity searches the open web, so PII in queries gets sent to external sources), and response handling (citations link to third-party sites). ## Prerequisites - Perplexity API key from [perplexity.ai/settings/api](https://www.perplexity.ai/settings/api) - Understanding of environment variable management - `.gitignore` configured to exclude secret files ## Instructions ### Step 1: API Key Management ```bash # .env (NEVER commit to git) PERPLEXITY_API_KEY=pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # .gitignore .env .env.local .env.*.local *.pem ``` ```typescript // Validate key format at startup function validateApiKey(key: string): void { if (!key) throw new Error("PERPLEXITY_API_KEY is not set"); if (!key.startsWith("pplx-")) { throw new Error("PERPLEXITY_API_KEY must start with 'pplx-'"); } if (key.length < 40) { throw new Error("PERPLEXITY_API_KEY appears truncated"); } } validateApiKey(process.env.PERPLEXITY_API_KEY || ""); ``` ### Step 2: Query Sanitization (Critical) Perplexity sends your query to the open web for search. Any PII in the query is exposed to external search infrastructure. ```typescript function sanitizeQuery(query: string): string { return query // Remove email addresses .replace(/\b[\w.+-]+@[\w-]+\.[\w.]+\b/g, "[email]") // Remove p...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

perplexity-data-handling

Implement Perplexity query sanitization, citation validation, result caching, and conversation context management for search workflows. Trigger with phrases like "perplexity data", "perplexity PII", "perplexity citations", "perplexity cache", "perplexity context".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-install-auth

Install and configure Perplexity Sonar API authentication. Use when setting up a new Perplexity integration, configuring API keys, or initializing the OpenAI-compatible client for Perplexity. Trigger with phrases like "install perplexity", "setup perplexity", "perplexity auth", "configure perplexity API key", "perplexity sonar setup".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-policy-guardrails

Implement content moderation, model selection policy, citation quality enforcement, and per-user usage quotas for Perplexity Sonar API. Trigger with phrases like "perplexity policy", "perplexity guardrails", "perplexity content moderation", "perplexity usage limits", "perplexity safety".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-common-errors

Diagnose and fix Perplexity Sonar API errors and exceptions. Use when encountering Perplexity errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "perplexity error", "fix perplexity", "perplexity not working", "debug perplexity", "perplexity 429".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-known-pitfalls

Identify and avoid Perplexity anti-patterns and common integration mistakes. Use when reviewing Perplexity code, onboarding new developers, or auditing existing integrations for best practices violations. Trigger with phrases like "perplexity mistakes", "perplexity anti-patterns", "perplexity pitfalls", "perplexity code review", "perplexity gotchas".

2,266 Updated today
jeremylongshore