Skip to content
Back to skills

2087 Security Assessment 5377f33a

ASecurity

```python class SecurityAssessment: """Assess OpenRouter security configuration."""

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
securitypythonapisecurity

Works with

  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2087-security-assessment_5377f33a --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2087 Security Assessment 5377f33a?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2087 Security Assessment 5377f33a
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2087-security-assessment-5377f33a/badge)](https://www.skillsdirectory.com/skills/tools-only-2087-security-assessment-5377f33a)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Security Assessment

## Security Assessment

### API Key Security
```python
class SecurityAssessment:
    """Assess OpenRouter security configuration."""

    def __init__(self, api_key: str):
        self.api_key = api_key
        self.findings = []

    def assess_key_storage(self) -> dict:
        """Check how API key is stored."""
        findings = []

        # Check if key is in environment
        if self.api_key == os.environ.get("OPENROUTER_API_KEY"):
            findings.append({
                "check": "key_storage",
                "status": "pass",
                "message": "API key stored in environment variable"
            })
        else:
            findings.append({
                "check": "key_storage",
                "status": "warning",
                "message": "API key may be hardcoded"
            })

        # Check key format
        if self.api_key.startswith("sk-or-"):
            findings.append({
                "check": "key_format",
                "status": "pass",
                "message": "Valid OpenRouter key format"
            })
        else:
            findings.append({
                "check": "key_format",
                "status": "fail",
                "message": "Invalid key format"
            })

        return findings

    def assess_key_limits(self) -> dict:
        """Check if key has spending limits."""
        try:
            response = requests.get(
                "https://openrouter.ai/api/v1/auth/key",
                headers={"Authorization": f"Bearer {self.api_key}"}
            )
            data = response.json()["data"]

            if data.get("limit"):
                return {
                    "check": "spending_limit",
                    "status": "pass",
                    "message": f"Key has ${data['limit']} limit"
                }
            else:
                return {
                    "check": "spending_limit",
                    "status": "warning",
                    "message": "No spending limit configured"
                }
        except Exception as e:
            return {
                "check": "spending_limit",
                "status": "error",
                "message": f"Could not check: {e}"
            }

    def run_assessment(self) -> dict:
        """Run full security assessment."""
        results = []
        results.extend(self.assess_key_storage())
        results.append(self.assess_key_limits())

        passed = sum(1 for r in results if r["status"] == "pass")
        warnings = sum(1 for r in results if r["status"] == "warning")
        failed = sum(1 for r in results if r["status"] == "fail")

        return {
            "summary": {
                "passed": passed,
                "warnings": warnings,
                "failed": failed,
                "total": len(results)
            },
            "findings": results
        }

# Run assessment
assessment = SecurityAssessment(os.environ["OPENROUTER_API_KEY"])
print(json.dumps(assessment.run_assessment(), indent=2))
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.