/palantir-pack:palantir-multi-env-setupfrom palantir-pack
Configures Palantir Foundry across dev, staging, and production environments with per-environment credentials, hostnames, and scope policies.
Ships in palantir-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Configure Foundry integrations across dev/staging/prod environments with separate credentials, enrollment hostnames, and scope policies per environment.
palantir-security-basics# src/config.py
import os
from dataclasses import dataclass
@dataclass
class FoundryEnvConfig:
hostname: str
client_id: str
client_secret: str
scopes: list[str]
ontology: str
ENVIRONMENTS = {
"development": FoundryEnvConfig(
hostname=os.environ.get("DEV_FOUNDRY_HOSTNAME", "dev.palantirfoundry.com"),
client_id=os.environ.get("DEV_FOUNDRY_CLIENT_ID", ""),
client_secret=os.environ.get("DEV_FOUNDRY_CLIENT_SECRET", ""),
scopes=["api:read-data"], # Read-only in dev
ontology="dev-ontology",
),
"staging": FoundryEnvConfig(
hostname=os.environ.get("STG_FOUNDRY_HOSTNAME", "staging.palantirfoundry.com"),
client_id=os.environ.get("STG_FOUNDRY_CLIENT_ID", ""),
client_secret=os.environ.get("STG_FOUNDRY_CLIENT_SECRET", ""),
scopes=["api:read-data", "api:write-data"],
ontology="staging-ontology",
),
"production": FoundryEnvConfig(
hostname=os.environ.get("PROD_FOUNDRY_HOSTNAME", "prod.palantirfoundry.com"),
client_id=os.environ.get("PROD_FOUNDRY_CLIENT_ID", ""),
client_secret=os.environ.get("PROD_FOUNDRY_CLIENT_SECRET", ""),
scopes=["api:read-data", "api:write-data", "api:ontology-read"],
ontology="production-ontology",
),
}
def get_config() -> FoundryEnvConfig:
env = os.environ.get("ENVIRONMENT", "development")
return ENVIRONMENTS[env]
import foundry
def create_client(config: FoundryEnvConfig) -> foundry.FoundryClient:
auth = foundry.ConfidentialClientAuth(
client_id=config.client_id,
client_secret=config.client_secret,
hostname=config.hostname,
scopes=config.scopes,
)
auth.sign_in_as_service_user()
return foundry.FoundryClient(auth=auth, hostname=config.hostname)
# Usage
config = get_config()
client = create_client(config)
# Docker Compose
# docker-compose.yml
services:
app:
environment:
- ENVIRONMENT=staging
- STG_FOUNDRY_HOSTNAME=staging.palantirfoundry.com
- STG_FOUNDRY_CLIENT_ID=${STG_CLIENT_ID}
- STG_FOUNDRY_CLIENT_SECRET=${STG_CLIENT_SECRET}
# Kubernetes
kubectl create secret generic foundry-creds \
--from-literal=hostname=prod.palantirfoundry.com \
--from-literal=client-id=xxx \
--from-literal=client-secret=yyy
# Cloud Run
gcloud run deploy my-app \
--set-env-vars ENVIRONMENT=production \
--set-secrets "PROD_FOUNDRY_CLIENT_SECRET=foundry-secret:latest"
def validate_environment():
"""Verify current environment configuration is valid."""
config = get_config()
env = os.environ.get("ENVIRONMENT", "development")
assert config.hostname, f"Missing hostname for {env}"
assert config.client_id, f"Missing client_id for {env}"
assert config.client_secret, f"Missing client_secret for {env}"
# Verify connectivity
client = create_client(config)
ontologies = list(client.ontologies.Ontology.list())
print(f"Environment {env}: connected to {config.hostname}")
print(f" Accessible ontologies: {[o.api_name for o in ontologies]}")
return True
| Issue | Cause | Fix |
|---|---|---|
| Wrong environment data | Misconfigured ENVIRONMENT var | Verify env var matches expected |
| Cross-env credentials | Shared secrets | Ensure each env has unique credentials |
| Dev writing to prod | Wrong hostname | Enforce read-only scopes in dev |
| Missing secrets | Not deployed | Run validation script before deploying |
For deep migration strategies, see palantir-migration-deep-dive.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
24 skills in this plugin
/palantir-ci-integrationConfigure CI/CD pipelines for Palantir Foundry integrations with GitHub Actions.
Use when setting up automated testing, running transforms validation,
or integrating Foundry SDK tests into your build process.
Trigger with phrases like "palantir CI", "foundry GitHub Actions",
"palantir automated tests", "CI foundry".
/palantir-common-errorsDiagnose and fix Palantir Foundry common errors and API exceptions.
Use when encountering Foundry errors, debugging failed API calls,
or troubleshooting transform build failures.
Trigger with phrases like "palantir error", "fix palantir",
"foundry not working", "debug foundry", "palantir 401 403".
/palantir-core-workflow-aBuild Palantir Foundry data pipelines using Python transforms.
Use when creating ETL pipelines, writing @transform decorators,
or building dataset-to-dataset processing in Foundry.
Trigger with phrases like "palantir pipeline", "foundry transform",
"palantir ETL", "palantir data pipeline", "foundry python transform".
/palantir-core-workflow-bWork with Palantir Foundry Ontology objects, actions, and queries via SDK.
Use when querying objects, applying actions, linking objects,
or building Ontology-driven applications.
Trigger with phrases like "palantir ontology", "foundry objects",
"palantir actions", "ontology query", "OSDK objects".
/palantir-cost-tuningOptimize Palantir Foundry costs through compute tuning, incremental builds, and usage monitoring.
Use when analyzing Foundry compute costs, reducing API usage,
or implementing cost monitoring for Foundry workloads.
Trigger with phrases like "palantir cost", "foundry billing",
"reduce foundry costs", "foundry pricing", "foundry expensive".
/palantir-data-handlingImplement Palantir Foundry data handling with PII protection, markings, and GDPR compliance.
Use when handling sensitive data in Foundry, implementing data classifications,
or ensuring compliance with privacy regulations.
Trigger with phrases like "palantir data", "foundry PII",
"palantir GDPR", "foundry data protection", "palantir markings".
npx claudepluginhub flight505/skill-forge --plugin palantir-packOther plugins' skills for the same job