secrets

A private configuration rule for storing credentials and API-call examples, including model, image-generation, and web-search settings. It is intended to stay out of Git through .gitignore.

In plain words
What is it for?
Use it to configure API keys, endpoints, model requests, image generation calls, and related authentication examples.
Why use it?
It keeps sensitive keys and personal connection details separate from files that may be shared or committed to a repository.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/itshen/xs_vibe_rules/secrets
Clone the repo
git clone --depth 1 https://github.com/itshen/xs_vibe_rules
Per session 1,799 This file is loaded in full into every session.
When invoked 1,799 The same file — it is already loaded in full.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01799 $0.01799
Opus 5 $0.00899 $0.00899
Sonnet 5 $0.00360 $0.00360
Haiku 4.5 $0.00180 $0.00180

Measured 2d ago against content hash 5d2d42431f33, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

secrets scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

resp = requests.post( "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent",

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions \
secrets.mdc · 199 lines

How it starts

The opening of the file, as written. The whole thing — 199 lines — stays where its author put it; the contents beside it link to each section on GitHub.

凭据与 API 调用配置(secrets.mdc)

⚠️ 此文件不上传 git——已加入 .gitignore。 在此填写你的真实 API Key、服务器 IP、个人信息等敏感内容。 rule-opensource.mdc 通过引用此文件提供完整的调用示例和凭据。


一、模型凭据与调用示例

1.1 默认对话模型

  • KEY:DASHSCOPE_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • 端点:https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
  • 调用示例:
curl https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -d '{
  "model": "qwen3.6-plus",
  "messages": [{"role": "user", "content": "你好"}],
  "enable_thinking": false
}'

1.2 图像生成模型

Gemini(主选)
  • KEY:GOOGLE_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • 文生图:
curl -X POST \
  "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent" \
  -H "x-goog-api-key: $GOOGLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "prompt"}]}],
    "generationConfig": {
      "responseModalities": ["TEXT", "IMAGE"],
      "imageConfig": {"aspectRatio": "16:9", "imageSize": "4K"}
    }
  }'
  • 垫图(图生图)Python 示例:
import os, base64, requests

with open('/path/to/reference.png', 'rb') as f:
    ref_b64 = base64.b64encode(f.read()).decode()

payload = {
    "contents": [{
        "parts": [
            {"text": "your prompt here"},
            {"inline_data": {"mime_type": "image/png", "data": ref_b64}}
        ]
    }],
    "generationConfig": {
        "responseModalities": ["TEXT", "IMAGE"],
        "imageConfig": {"aspectRatio": "3:4", "imageSize": "2K"}
    }
}

resp = requests.post(
    "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent",
    headers={"x-goog-api-key": os.getenv("GOOGLE_API_KEY"), "Content-Type": "application/json"},
    json=payload,
    proxies={"http": "http://127.0.0.1:7890", "https": "http://127.0.0.1:7890"},
    timeout=120
)

data = resp.json()
parts = data.get('candidates', [{}])[0].get('content', {}).get('parts', [])
for p in parts:
    if 'inlineData' in p:
        with open('/path/to/output.png', 'wb') as f:
            f.write(base64.b64decode(p['inlineData']['data']))
        print('SAVED OK')
        break

Read the full file on GitHub · 199 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 199 lines · 1,799 tokens per session scan B 5d2d42431f33

Subscribe to this mod's changes

secrets is a cursor rule published in the GitHub repository itshen/xs_vibe_rules (42 stars, last pushed 2mo ago), licensed MIT. It adds 1,799 tokens to every session, about $0.0090 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.