Skip to content
Skillpedia
Security18k · #10656

infisical-sync-skill

What it does

This skill gives API reference and safety guidance for working with secrets in a self-hosted Infisical vault, including logging in with a machine identity and listing secrets. It is for developers who keep credentials in a secure store.

When to use it

  • ✓When you need to list, read or update secrets stored in an Infisical vault.
  • ✓When your agent must log in to Infisical with a machine identity.
  • ✓When an Infisical API call fails and you need to understand the error.

Skill link

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-hands/bundled/infisical-sync/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-hands/bundled/infisical-sync/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“List the secret names in our staging Infisical environment so I can compare them with our config file.”

5 new skills a week. 1 minute to read.

How it works

The skill walks through logging in with a client ID and secret to get a short-lived token, then calling the secrets endpoints for the right project and environment.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Infisical Sync Expert Knowledge

1. Infisical API Reference

Base URL

All requests go to $INFISICAL_URL. This is the self-hosted instance base URL, e.g. https://infisical.example.com.

Authentication — Universal Auth

Infisical uses Machine Identities with Universal Auth for agent-to-agent communication.

Endpoint: POST /api/v1/auth/universal-auth/login

Request:

{
  "clientId": "<INFISICAL_CLIENT_ID>",
  "clientSecret": "<INFISICAL_CLIENT_SECRET>"
}

Response (success):

{
  "accessToken": "eyJ...",
  "expiresIn": 7200,
  "accessTokenMaxTTL": 43200,
  "tokenType": "Bearer"
}

curl example:

RESPONSE=$(curl -s -X POST "$INFISICAL_URL/api/v1/auth/universal-auth/login" \
  -H "Content-Type: application/json" \
  -d "{\"clientId\":\"$INFISICAL_CLIENT_ID\",\"clientSecret\":\"$INFISICAL_CLIENT_SECRET\"}")

ACCESS_TOKEN=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['accessToken'])")

Token lifetime: expiresIn seconds (usually 7200 = 2 hours). Re-authenticate when expired.


List Secrets

Endpoint: GET /api/v4/secrets

Query parameters:

Param Required Description
projectId Yes Infisical project ID
environment Yes Environment slug (e.g. prod, staging, dev)
secretPath No Path prefix, default /
includeImports No Include imported secrets, default false
recursive No Include secrets in sub-paths, default false

curl example:

curl -s -X GET \
  "$INFISICAL_URL/api/v4/secrets?projectId=$PROJECT_ID&environment=$ENVIRONMENT&secretPath=/" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Response shape:

{
  "secrets": [
    {
      "id": "uuid",
      "version": 1,
      "secretKey": "DATABASE_URL",
      "secretValue": "postgres://...",
      "secretComment": "",
      "environment": "prod",
      "workspace": "uuid"
    }
  ],
  "imports": []
}

Parse with:

echo "$RESPONSE" | python3 -c "
import sys, json
data = json.load(sys.stdin)
for s in data.get('secrets', []):
    print(s['secretKey'])
"

Create or Update a Secret

The API does not provide a single upsert endpoint. POST creates only (returns 409 if the secret already exists); PATCH updates only (returns 404 if missing). Use the create-then-update pattern:

Step 1 — Try to create (POST)
Endpoint: POST /api/v4/secrets/{secretName}

Request body:

{
  "projectId": "<PROJECT_ID>",
  "environment": "<ENV>",
  "secretValue": "<VALUE>",
  "secretPath": "/"
}
HTTP_STATUS=$(curl -s -o /tmp/infisical_response.json -w "%{http_code}" \
  -X POST "$INFISICAL_URL/api/v4/secrets/$SECRET_NAME" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"projectId\":\"$PROJECT_ID\",\"environment\":\"$ENVIRONMENT\",\"secretValue\":\"$SECRET_VALUE\",\"secretPath\":\"/\"}")

Returns 201 on success.

Step 2 — If 409, update via PATCH
Endpoint: PATCH /api/v4/secrets/{secretName}

if [ "$HTTP_STATUS" = "409" ]; then
  HTTP_STATUS=$(curl -s -o /tmp/infisical_response.json -w "%{http_code}" \
    -X PATCH "$INFISICAL_URL/api/v4/secrets/$SECRET_NAME" \
    -H "Authorization: Bearer $ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"projectId\":\"$PROJECT_ID\",\"environment\":\"$ENVIRONMENT\",\"secretValue\":\"$SECRET_VALUE\",\"secretPath\":\"/\"}")
fi

Returns 200 on success. Any other status code is an error.

Important: URL-encode the secret name if it contains special characters.


Delete a Secret

Endpoint: DELETE /api/v4/secrets/{secretName}

Query parameters: projectId, environment, secretPath (default /)

curl example:

curl -s -X DELETE \
  "$INFISICAL_URL/api/v4/secrets/$SECRET_NAME?projectId=$PROJECT_ID&environment=$ENVIRONMENT&secretPath=/" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

List Accessible Projects (Workspaces)

Endpoint: GET /api/v1/workspace

curl -s -X GET "$INFISICAL_URL/api/v1/workspace" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Response: { "workspaces": [{ "id": "uuid", "name": "...", "environments": [...] }] }


2. HTTP Error Codes

Code Meaning Action
200/201 Success Continue
400 Bad Request Log the response body — likely malformed JSON or missing
FAQ

Do I need a machine identity?

Yes. The skill uses Universal Auth with a client ID and client secret to log in.

How long does the login token last?

The skill notes the token usually lasts about two hours, after which the agent must log in again.

Where does the vault address come from?

It is your self-hosted Infisical address, which the skill reads from an environment variable.

Details

Original description by the author

Expert knowledge for the Infisical Sync Hand — Infisical API reference, vault operations, error patterns, security guidance

repo: RightNow-AI/openfang

Popularity

GitHub stars
18k
Ranking position
#10656
License
Apache-2.0
Updated
7/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills