tender-safe-query

Tender Safety Query Example: A second run-through sample for integration-contract that uses a CloudBase MySQL read-only account (tender_ro) to perform SELECT-only tender analysis queries. External outputs enforce masking (purchaser/budget/award/contact/person/phone), full audit logging; source tender platforms are read-only pulls and agents never write back. Intended as a reference for tender analysis queries or a reusable "read-only account + masking contract" before approvals (priority: yellow).

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "tender-safe-query" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-742825a5e027dea969cc71e9960c2b6086534e78ed54e6f383da9a5a1d319172. Verify the upstream source and version against https://skillhub.cn/skills/user_03fbb66c/guoyuanxin-tender-safe-query before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Tender Safety Query Example: A second run-through sample for integration-contract that uses a CloudBase MySQL read-only account (tender_ro) to perform SELECT-only tender analysis queries. External outputs enforce masking (purchaser/budget/award/contact/person/phone), full audit logging; source tender platforms are read-only pulls and agents never write back. Intended as a reference for tender analysis queries or a reusable "read-only account + masking contract" before approvals (priority: yellow).

0 Downloads

Introduction source: third_party · user_03fbb66c · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: tender-safe-query
description: 招投标安全查询实例(integration-contract 的第二个跑通样本,优先级🟡)。使用 CloudBase MySQL 只读账号 tender_ro 查询招投标分析数据,仅 SELECT,对外渠道强制脱敏(采购人/预算/中标/联系人/电话),全量审计留痕。招标源平台为只读拉取、Agent 永不回写。当需要做招投标分析查询、或作为"只读账号+脱敏契约"在 K审批 之前的复用样板时参考。
slug: guoyuanxin-tender-safe-query
displayName: 招投标安全查询(只读+脱敏)
version: 1.0.0
summary: 招投标安全查询实例,使用只读账号仅 SELECT 查询,对外渠道强制脱敏(采购人/预算/中标/联系人/电话),招标源只读拉取,是「只读账号+脱敏契约」的复用样板。
license: MIT

招投标安全查询(契约第二个实例)

本 skill 是 integration-contract 五条契约在招投标场景的已跑通样板(与 bi-safe-query 同模板、独立隔离)。 创建日期:2026-07-14。状态:沙箱跑通,待接真实招投标库。

契约履行情况(对照 integration-contract)

契约 本实例做法 状态
只读账号 CloudBase MySQL 账号 tender_ro@%,GRANT SELECT ON tender_sandbox.* 唯一授权 ✅ 已建已验证
只增不删 query_tender.py 用 is_select_only() 拒绝非 SELECT;连接账号无写权限。另:招标源平台(爬虫/API)只读拉取,Agent 永不回写源平台 ✅
脱敏 desensitize.py 按 PERSONA.md 剥离 purchaser/budget/winning_amount/contact/phone ✅ 已跑通
异常熔断 查询超时 connect_timeout=5;非 SELECT 直接 PermissionError;爬虫侧设重试上限 ✅ 基础版
全量留痕 audit() 写 audit/audit.log.jsonl(操作人/时间/SQL/行数/渠道) ✅ 已跑通

文件结构

tender-safe-query/
├── SKILL.md
├── config.local.example.json        # 演示连接配置(生产由环境变量注入)
├── scripts/
│   ├── query_tender.py      # 查询执行件(仅 SELECT,云函数环境运行)
│   └── desensitize.py       # 脱敏 + 审计模块(本机可跑演示)

审计日志在运行时生成于 audit/audit.log.jsonl(本发布包不含演示日志)。

如何使用

本机演示脱敏逻辑(无需 DB 网络)

python scripts/desensitize.py

输出内部渠道原样 + 对外渠道脱敏(某采购人 / 金额属商业机密 / 相关同事 / ***) + 审计记录。

云函数内真实查询(同 VPC 可直连 172.17.0.6:3306)

from scripts.query_tender import run_tender_query
safe_rows = run_tender_query(
    "SELECT region,project_name,purchaser,budget,winning_amount,contact,phone FROM tender_sandbox.tender_notice ORDER BY budget DESC",
    channel='external',        # 飞书/企微 → 脱敏;internal → 原样
    operator='guo_yuanxin'
)

生产替换三步(接真实招投标数据)

  1. 指向真实库:把 tender_ro 的 GRANT 改为真实招投标 schema(如 GRANT SELECT ON tender_prod.* TO 'tender_ro'@'%'),更新 config.local.example.json 的 database。
  2. 删除沙箱:DROP SCHEMA tender_sandbox(仅演示数据)。
  3. 渠道路由:对飞书/企微调用传 channel='external' 自动脱敏;本地/内部会话传 internal。
  4. 源平台拉取:爬虫/API 采集层保持只读,落地到本地分析库后,用 tender_ro 做只读报表查询(两层隔离)。

安全提示

  • tender_ro 口令存于 config.local.example.json(演示用)。生产环境由 CloudBase 环境变量注入,勿提交真实口令。
  • 本账号仅有 SELECT,即便凭据泄露也无法篡改业务数据(只读账号契约)。
  • 招标源为公开/授权平台,采集须遵守平台 robots 与合规边界(只读、限频、不回写)。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供招投标安全查询的完整样板,解决企业数据安全与合规查询痛点
  • 实现只读账号+脱敏契约的双重安全保障,具有明确商业价值
Trigger Precision85/100

Highlights

  • 触发词精准完整,覆盖招投标安全查询、只读账号、脱敏、审计等核心概念
  • 使用场景描述清晰,边界明确,不易误触
Structure and Standards92/100

Highlights

  • 契约履行对照表清晰展示五条安全契约的实现情况
  • 文件结构、使用方式、生产替换步骤完整规范
  • 安全提示详尽,覆盖生产环境部署要点
Execution Reliability88/100

Highlights

  • 只读账号设计确保数据不可篡改,安全性高
  • 异常熔断机制完善(超时控制、非SELECT拒绝)
  • 全量审计留痕,满足合规要求
Evidence Verifiability (mean of the first four)86/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.