# Send Perplexity AI Search - security-hardened version (bash-based) to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "perplexity-safe",
    "name": "Perplexity AI Search - security-hardened version (bash-based)",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/haru3613/perplexity-safe",
    "canonicalUrl": "https://clawhub.ai/haru3613/perplexity-safe",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/perplexity-safe",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=perplexity-safe",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "package.json",
      "SKILL.md",
      "scripts/perplexity_search.sh",
      ".claude/settings.local.json"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "perplexity-safe",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T00:25:35.074Z",
      "expiresAt": "2026-05-14T00:25:35.074Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=perplexity-safe",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=perplexity-safe",
        "contentDisposition": "attachment; filename=\"perplexity-safe-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "perplexity-safe"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/perplexity-safe"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/perplexity-safe",
    "downloadUrl": "https://openagent3.xyz/downloads/perplexity-safe",
    "agentUrl": "https://openagent3.xyz/skills/perplexity-safe/agent",
    "manifestUrl": "https://openagent3.xyz/skills/perplexity-safe/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/perplexity-safe/agent.md"
  }
}
```
## Documentation

### Overview

This skill provides access to the Perplexity API for web-grounded AI search. It combines large language models with real-time web search, providing accurate, up-to-date answers with source citations.

This is a security-hardened version that fixes command injection vulnerabilities found in the original perplexity-bash skill.

### When to Use Perplexity vs. Built-in Search

Use Perplexity when:

You need current information (news, prices, events, recent developments)
The user asks for source citations or references
The user specifically mentions Perplexity or wants research-style answers

Use built-in web search when:

Simple factual queries
Quick information lookup
Basic URL or content retrieval

### Model Selection Guide

ModelUse CaseCostsonarDefault search, most queriesLowsonar-proAdvanced search, deeper understandingMediumsonar-reasoningComplex multi-step reasoningMediumsonar-reasoning-proAdvanced reasoning with deep contentHigh

### Basic Search

# Simple query (uses sonar by default)
scripts/perplexity_search.sh "What is the capital of Germany?"

# With a different model
scripts/perplexity_search.sh -m sonar-pro "Latest AI developments"

# Markdown format with citations
scripts/perplexity_search.sh -f markdown "Tesla stock analysis"

### Advanced Usage

# High context for comprehensive results
scripts/perplexity_search.sh -m sonar-reasoning -c high -f markdown \\
  "Compare AI models performance benchmarks"

# With custom system prompt
scripts/perplexity_search.sh -s "You are a technology analyst." \\
  "Analyze current tech trends"

### Options

FlagDescriptionDefault-m, --modelModel to usesonar-t, --max-tokensMaximum tokens (1-4096)4096--temperatureSampling temperature (0.0-1.0)0.0-c, --contextSearch context: low/medium/highmedium-s, --systemSystem prompt(none)-f, --formatOutput: text/markdown/jsontext--list-modelsList available models

### Search Context Size

low - Faster, fewer sources. Good for simple queries.
medium (default) - Balanced for most use cases.
high - Most comprehensive. Best for research.

### API Key Configuration

Option 1: Config file (recommended)
Create config.json in the skill directory:

{
  "apiKey": "pplx-your-key-here"
}

Option 2: Environment variable

export PERPLEXITY_API_KEY="your-key-here"

Priority: Config file > environment variable.

### Dependencies

bash (4.0+)
curl
python3 (for JSON construction only - no user input is eval'd)

### Security Notes

This version addresses the following vulnerabilities found in the original:

No command injection - User input is passed to Python via environment variables, never interpolated into code strings
Input validation - All parameters are validated (numeric ranges, allowed model names, allowed context values)
API key protection - The Authorization header is passed to curl via a temporary config file (curl -K, mode 600) and the request body via stdin (--data @-), so neither the API key nor the body appear in process listings (ps aux)
Query length limit - Queries are capped at 8000 characters to prevent denial-of-wallet attacks
Strict model allowlist - Only known valid models are accepted

### Cost Awareness

Perplexity API is not free. Be mindful of usage:

Simple queries: ~$0.005-$0.015 per query
Deep research: ~$0.015-$0.03+ per query
Default to sonar for most queries to keep costs low.

### Troubleshooting

Error: No API key found - Set up API key as described above
Error: curl not found - Install curl for your system
Error: Invalid model - Use --list-models to see available models
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: haru3613
- Version: 1.0.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-07T00:25:35.074Z
- Expires at: 2026-05-14T00:25:35.074Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/perplexity-safe)
- [Send to Agent page](https://openagent3.xyz/skills/perplexity-safe/agent)
- [JSON manifest](https://openagent3.xyz/skills/perplexity-safe/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/perplexity-safe/agent.md)
- [Download page](https://openagent3.xyz/downloads/perplexity-safe)