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.
npx agentmods add skills/artisancloud/powerx/stsnpx skills add ArtisanCloud/PowerX --skill stsgit clone --depth 1 https://github.com/ArtisanCloud/PowerXWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/artisancloud/powerx/sts)<a href="https://agentmods.dev/skills/artisancloud/powerx/sts"><img src="https://agentmods.dev/badge/skills/artisancloud/powerx/sts.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00025 | $0.01431 |
| Opus 5 | $0.00013 | $0.00715 |
| Sonnet 5 | $0.00005 | $0.00286 |
| Haiku 4.5 | $0.00003 | $0.00143 |
Grade A, and why
sts scanned grade A with 0 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 today.
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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PowerX STS
步骤
- 打开
本文件内嵌规则。 - 按规则执行实现/校对。
- 完成后按核对清单验收。
核对点
- 与 PowerX 当前代码结构、路径与命名一致。
- 仅在传输层/契约层做职责内改动,不跨层越界。
规则(内嵌)
dev_sts_guides.md
# PowerX STS & 插件对接规范
> 目标:定义插件以**租户维度**访问 PowerX 的鉴权方式(STS 令牌交换)、凭证生成/轮换、令牌使用与安全要求。
> 传输层可为 gRPC/HTTP,拦截器/中间件与 Crypto KeyRing 统一。
## 1. 范围与术语
- STS(Security Token Service):`Exchange(client_id, client_secret, aud, scope, ttl)` → 短期 JWT。
- 客户端:插件进程(per-tenant)。
- KeyRing:HS256 密钥集合(带 `kid`),STS 与 gRPC 拦截器共用。
## 2. 架构与目录
- STS 服务:`internal/transport/grpc/auth/sts_handler.go`(`Exchange`)
- KeyRing:`internal/transport/grpc/auth/key_ring.go`
- gRPC 拦截器:`internal/transport/grpc/auth/middleware/auth_interceptor.go`
- Proto:`api/grpc/contracts/powerx/auth/sts/v1/sts.proto`(Buf 生成到 `api/grpc/gen/go/...`)
- 插件-宿主关系与访问形态:详见《powerx_agent_plugin.md》。
## 3. 凭证模型(租户维度)
- 启用插件生成:`plugin_instance_configs(tenant_id, plugin_id, key="auth.credentials")`
- 字段:`client_id`(`<pluginID>.<tenantID>`)、`client_secret_hash`(仅存 hash)。
- 明文 `client_secret` 仅创建/轮换时展示一次,插件自行安全保存。
- 轮换:旧 secret 立即失效,插件更新后继续 Exchange。
## 4. 令牌交换(STS Exchange)
- 请求:`client_id`、`client_secret`、`audience=powerx:api`、`scope=access`、`ttl=300(秒)`。
- 返回:`access_token`(HS256,header.kid 写入)、`expires_in`、`aud`、`scope`、`iss`、`sub=client:<client_id>`。
- 验证:STS 验签与 gRPC 拦截器使用**同一 KeyRing**(kid 选择密钥)。
## 5. 令牌使用(插件 → PowerX)
- gRPC:在 metadata 设置 `authorization: Bearer <token>`;拦截器校验通过后带入 `tenant_id/actor` 上下文。
- HTTP(如需):中间件与 STS 对齐验签策略(issuer/secret/kid)。
- 客户端缓存:仅内存缓存;若剩余寿命 <60s 先刷新;401/403 触发强制刷新再重试一次。
### 5.1 HTTP direct route 边界
- 插件调用底座能力的推荐主路径是 `/api/v1/tenant/invocations`。
- 插件 STS token 直接访问 Core HTTP 时,允许集合由 capability governance 管理:
`static plugin runtime contracts + formal platform_capabilities REST endpoints - STS blocklist`。
- 普通开放 REST 能力必须先进入正式 `backend/config/platform_capabilities/*.yaml` 的 REST protocol;不得通过手工改 STS validator 代替能力登记。
- `/api/v1/admin/*` 是后台用户态 API 命名空间。插件 Admin 页面、PowerX Admin 页面、以及任何携带用户 JWT 的后台请求,仍然由用户鉴权、租户成员、RBAC 和业务权限判定,不受服务态 STS direct blocklist 影响。
- 普通 STS token 是插件服务态身份,不携带 `uid/mid`,不能代表登录用户调用 `/api/v1/admin/*` 绕过用户 RBAC。插件后端如果要代表当前用户调用底座后台 API,必须引入 delegated/on-behalf-of 机制。
- 对服务态 STS direct call,`/admin/*`、`/internal/*`、`/public/*`、`/auth/*`、`/setup/*`、debug、migration、root、drain、bootstrap、mock、health、根级动态路径默认不允许。确认为插件服务运行时合同的少量入口必须进入 static allow 并补测试。
## 6. 安全与审计
- TTL 建议 2–10 分钟;`client_secret` 安全存储;校验 `aud/scope` 最小权限;
- 审计:记录 Exchange/业务调用的 `tenant/plugin/subject/trace_id`;异常 401/403 计数告警。
- 禁止在 `tenant_id=0` 上下文下生成租户凭证。
## 7. 与 Agent/插件关系(何时走 MCP)
- 插件直调 PowerX(gRPC/HTTP)或对外自暴露服务;
- 需要纳入统一“工具目录/市场”时,将插件能力包装为 MCP 工具(详见《powerx_agent_plugin.md》)。
## 8. 验收要点(Checklist)
- [ ] 存在 STS `Exchange` 实现与注册,Proto 契约落在 `powerx/auth/sts/v1`;
- [ ] KeyRing(HS256+`kid`)与拦截器复用,STS 签发的 token 可直接通过业务 RPC 鉴权;
- [ ] 插件凭证落在 `plugin_instance_configs`(仅存 hash),支持“轮换”;
- [ ] 客户端仅内存缓存 token,支持预刷新与 401/403 强制刷新;
- [ ] 审计与安全策略(TTL/aud/scope/告警)到位;
- [ ] 与 HTTP/gRPC 的错误语义一致(Unauthenticated/PermissionDenied)。
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- today First seen · 83 lines · 25 tokens per session scan A ed92c0e25552
sts is a skill published in the GitHub repository ArtisanCloud/PowerX (364 stars, last pushed 4d ago), licensed Apache-2.0. It adds 25 tokens to every session and 1,431 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.
Other skills, from other repositories
scalar-docs
Skill for writing and updating scalar.config.json — Scalar Docs configuration reference for users and LLMs.
openapi-glossary
Use consistent OpenAPI terminology and definitions when writing documentation, educational material, and tooling guidance.
wxjava-api-contributor
按 WxJava 的 Maven 多模块、Java 8、公共 API 兼容性和 TestNG 约定,为微信官方接口新增或维护 SDK 支持。适用于新增 Service API、请求响应 Bean、序列化、HTTP 实现、Starter 配置或回归测试时。.
datamodel-code-generator
Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…
langbot-deploy
Deploy and configure a LangBot instance — Docker / Docker Compose, Kubernetes, the config.yaml model, the Box sandbox runtime, the plugin runtime, and the global API key. Use when installing, deploying, upgrading, or configuring LangBot in production or self-hosted environments. Triggers on "deploy langbot", "langbot…
om-auto-sec-report-pr
Paranoid OWASP-oriented security analysis for a SINGLE unit of work — one PR, one spec under .ai/specs/, or one branch diff. Hunts non-obvious attack vectors beyond OWASP Top 10, flags same-pattern hotspots elsewhere, and emits "Next steps — go deeper" follow-ups. Writes markdown + HTML under .ai/analysis/; runs…