VA

vastai-security-basics

Security guidelines for protecting Vast.ai credentials and infrastructure access.

Install

mkdir -p .claude/skills/vastai-security-basics && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3076" && unzip -o skill.zip -d .claude/skills/vastai-security-basics && rm skill.zip

Installs to .claude/skills/vastai-security-basics

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Apply Vast.ai security best practices for API keys and instance access.
71 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Prevent API keys from being committed to git
  • Load API keys from environment variables
  • Generate dedicated SSH key pairs for Vast.ai
  • Securely wipe data before destroying instances
  • Use SSH tunnels for services on instances
  • Encrypt training data before upload

How it works

The skill provides instructions and code examples for managing API keys as environment variables, generating and uploading dedicated SSH keys, and implementing secure data cleanup procedures for Vast.ai instances.

Inputs & outputs

You give it
Vast.ai API keys, SSH access to GPU instances, and data on rented hardware
You get back
Securely managed API keys, hardened SSH access, and protected data on Vast.ai instances

When to use vastai-security-basics

  • Secure Vast.ai API keys
  • Harden SSH access for GPU instances
  • Audit security configurations

About this skill

Vast.ai Security Basics

Overview

Security best practices for Vast.ai API keys, SSH access to GPU instances, data protection on rented hardware, and credential management. Vast.ai instances run as root on shared hardware, requiring careful attention to data lifecycle.

Prerequisites

  • Vast.ai account with API key
  • Understanding of SSH key management
  • Secrets manager available (optional but recommended)

Instructions

Step 1: API Key Management

# Never commit API keys to git
echo '.vast_api_key' >> .gitignore
echo '.env' >> .gitignore

# Use environment variables, not files in repos
export VASTAI_API_KEY="$(vault kv get -field=api_key secret/vastai)"

# Rotate keys periodically at cloud.vast.ai > Account > API Keys
# Fail fast on missing credentials
import os

def get_api_key():
    key = os.environ.get("VASTAI_API_KEY")
    if not key:
        key_file = os.path.expanduser("~/.vast_api_key")
        if os.path.exists(key_file):
            key = open(key_file).read().strip()
    if not key:
        raise ValueError("VASTAI_API_KEY not set and ~/.vast_api_key not found")
    return key

Step 2: SSH Key Security

# Generate a dedicated key pair for Vast.ai instances
ssh-keygen -t ed25519 -f ~/.ssh/vastai_key -C "vastai-instances" -N ""

# Upload public key at cloud.vast.ai > Account > SSH Keys

# Use the dedicated key for connections
ssh -i ~/.ssh/vastai_key -p PORT root@HOST

Step 3: Data Protection on Shared Hardware

def secure_cleanup(instance_id, ssh_host, ssh_port):
    """Securely wipe data before destroying an instance."""
    import subprocess
    # Overwrite sensitive files before instance destruction
    subprocess.run([
        "ssh", "-p", str(ssh_port), "-o", "StrictHostKeyChecking=no",
        f"root@{ssh_host}",
        "rm -rf /workspace/data /workspace/checkpoints /root/.ssh/authorized_keys; "
        "history -c"
    ], check=True)
    # Then destroy
    subprocess.run(["vastai", "destroy", "instance", str(instance_id)], check=True)

Step 4: Network Security

  • Use SSH tunnels for any services exposed on instances
  • Never expose ports with sensitive data to the public internet
  • Transfer data over SCP/SFTP, not unencrypted HTTP
  • Encrypt training data before upload; decrypt on-instance

Step 5: Credential Rotation Checklist

  • API key rotated every 90 days
  • SSH keys dedicated to Vast.ai (not shared with production)
  • Old SSH keys removed from cloud.vast.ai after rotation
  • .vast_api_key file permissions set to 600
  • No API keys in shell history (export from a sourced file, not typed)

Output

  • API key loaded from environment or secrets manager
  • Dedicated SSH key pair for Vast.ai instances
  • Secure cleanup before instance destruction
  • Network security guidelines
  • Credential rotation checklist

Error Handling

ErrorCauseSolution
API key leaked in gitCommitted .env or key fileRotate key immediately; add to .gitignore
SSH key rejectedWrong key or not uploadedVerify key is at cloud.vast.ai > SSH Keys
Data left on destroyed instanceForgot to clean upUse secure_cleanup() before destroy
Key file world-readableWrong permissionschmod 600 ~/.vast_api_key ~/.ssh/vastai_key

Resources

Next Steps

For production deployment checklist, see vastai-prod-checklist.

Examples

Vault integration: Load API key from HashiCorp Vault at runtime, never write to disk, and use SSH agent forwarding for key management.

Ephemeral instances: Treat every Vast.ai instance as throwaway. Never store persistent state on instances; always upload data, process, download results, and destroy.

Prerequisites

Vast.ai account with API keyUnderstanding of SSH key management

Limitations

  • API key can be leaked if committed to git
  • SSH key can be rejected if not uploaded or wrong key is used
  • Data can be left on destroyed instance if cleanup is forgotten

How it compares

This skill offers specific security patterns for Vast.ai's shared hardware environment, including secure cleanup and key management, which differs from generic cloud security advice.

Compared to similar skills

vastai-security-basics side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
vastai-security-basics (this skill)327dReviewIntermediate
reverse-engineering-tools734moNo flagsAdvanced
game-hacking-techniques422moNo flagsAdvanced
solidity-security152moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

reverse-engineering-tools

gmh5225

Guide for reverse engineering tools and techniques used in game security research. Use this skill when working with debuggers, disassemblers, memory analysis tools, binary analysis, or decompilers for game security research.

73204

game-hacking-techniques

gmh5225

Guide for game hacking techniques and cheat development. Use this skill when researching memory manipulation, code injection, ESP/aimbot development, overlay rendering, or game exploitation methodologies.

42128

solidity-security

wshobson

Master smart contract security best practices to prevent common vulnerabilities and implement secure Solidity patterns. Use when writing smart contracts, auditing existing contracts, or implementing security measures for blockchain applications.

15115

1password

openclaw

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.

2799

senior-security

davila7

Comprehensive security engineering skill for application security, penetration testing, security architecture, and compliance auditing. Includes security assessment tools, threat modeling, crypto implementation, and security automation. Use when designing security architecture, conducting penetration tests, implementing cryptography, or performing security audits.

3191

ghidra

mitsuhiko

Reverse engineer binaries using Ghidra's headless analyzer. Decompile executables, extract functions, strings, symbols, and analyze call graphs without GUI.

16105

Search skills

Search the agent skills registry