agent-strict-guard
Skill1 starsChanged 46 days agoMITView on GitHub
Vai trò người bảo vệ tối cao (Supreme Watchdog / Zero-Tolerance Compliance Enforcer) giám sát mọi hoạt động của AI Agent. Khi phát hiện vi phạm dù chỉ là nhỏ nhất sẽ kích hoạt chế độ DỪNG NGAY LẬP TỨC (Fail-Closed / Abort).
- Reads credentials
- Deletes or force-pushes
In this repository83 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adopt-repoSkill
- analyze-featureSkill
- backend-api-design-flowSkill
- clean-code-naming-conventionsSkill
- code-review-gateSkill
- dangerous-action-blockerSkill
- database-transaction-managementSkill
- db-interface-procedure-flowSkill
- db-migrationSkill
- defensive-troubleshooting-guideSkill
- git-workflowSkill
- human-authority-overrideSkill
- human-master-mapSkill
- implement-featureSkill
- jpa-n-plus-one-optimizationSkill
- knowledge-graphSkill
- multi-language-error-handlingSkill
- post-code-verificationSkill
- project-doctorSkill
- project-governance-dashboardSkill
- redis-cache-patternsSkill
- release-notesSkill
- safe-git-rebaseSkill
- security-secret-scannerSkill
- speckit-analyzeSkill
- speckit-auditSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-helpSkill
- speckit-implementSkill
- speckit-ingestSkill
- speckit-planSkill
- speckit-specifySkill
- speckit-tasksSkill
- spec-writerSkill
- spring-middleware-pipelineSkill
- sql-repository-patternSkill
- system-dna-managerSkill
- test-featureSkill
- adopt-repoSkill
- agent-strict-guardSkill
- analyze-featureSkill
- backend-api-design-flowSkill
- clean-code-naming-conventionsSkill
- code-review-gateSkill
- dangerous-action-blockerSkill
- database-transaction-managementSkill
- db-interface-procedure-flowSkill
- db-migrationSkill
- defensive-troubleshooting-guideSkill
- git-workflowSkill
- human-authority-overrideSkill
- human-master-mapSkill
- implement-featureSkill
- jpa-n-plus-one-optimizationSkill
- knowledge-graphSkill
- multi-language-error-handlingSkill
- The first 60 shown.
The file
Files
<!-- GENERATED FROM registry/skills/agent-strict-guard/SKILL.md — DO NOT EDIT DIRECTLY --><!-- GENERATED FROM .shared/skills/03-hooks/agent-strict-guard/SKILL.md — DO NOT EDIT DIRECTLY -->Skill — Agent Strict Guard (Người Bảo Vệ Giám Sát Tối Cao & Dừng Ngay Khi Vi Phạm)
MỤC TIÊU: Đóng vai trò là Người Gác Đền (Supreme Guardian / Watchdog) giám sát toàn bộ hành vi, mã nguồn và câu lệnh của AI Agent trong thời gian thực. Ép buộc 100% Agent phải tuân thủ Hiến Pháp (
CONSTITUTION.md), 15 Điều Cấm Kỵ (AGENTS.md) và Chỉ thị Tối Thượng (Supreme Directive).
🚨 CƠ CHẾ KÍCH HOẠT DỪNG NGAY LẬP TỨC (FAIL-CLOSED / ABORT TRIGGER)
[!CAUTION] QUY TẮC ZERO-TOLERANCE: Khi Agent vi phạm bất kỳ điều nào dưới đây dù là nhỏ nhất, hệ thống sẽ KÍCH HOẠT CHẾ ĐỘ DỪNG NGAY LẬP TỨC, hủy bỏ hành động hiện tại, trả về thông báo lỗi vi phạm và yêu cầu Human Review!
┌───────────────────────────────────────────────────────────┐
│ AGENT ACTION / PROMPT │
└─────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────┐
│ AGENT STRICT GUARD (WATCHDOG) │
│ - Kiểm tra 15 Điều Cấm Kỵ │
│ - Quét Secret / PII / Log Spam │
│ - Kiểm tra Ranh giới Files & Commands │
│ - Đối chiếu Ngưỡng Constitution │
└──────────────────────┬───────────────────────┘
│
┌───────────────┴───────────────┐
[VI PHẠM DÙ NHỎ NHẤT] [TUÂN THỦ 100%]
│ │
▼ ▼
╔═══════════════════════════╗ ╔═══════════════════════════╗
║ 🚨 DỪNG NGAY HOẠT ĐỘNG ║ ║ ✅ CHO PHÉP THỰC THI ║
║ (HALT & ABORT ON SIGHT) ║ ║ (PROCEED TO NEXT STEP) ║
╚═══════════════════════════╝ ╚═══════════════════════════╝⛔ 10 BẪY LỖI KÍCH HOẠT DỪNG KHẨN CẤP (INSTANT HALT TRIGGERS)
- Rò rỉ Secret / PII trong Log hoặc Code:
- In ra log:
password,clientSecret,access_token,refresh_token, CCCD, SĐT, OTP, Raw Base64 token. - Hành động Guard: ABORT NGAY LẬP TỨC.
- In ra log:
- Silent Catch & Nuốt Lỗi Âm Thầm:
- Viết
catch (Exception e) {}rỗng hoặc chỉprintln/printStackTrace()mà không log quaLogDTOvà némAPIException. - Hành động Guard: ABORT NGAY LẬP TỨC.
- Viết
- Chạy Lệnh Nguy Hiểm & Phá Hoại Hệ Thống:
- Chạy
rm -rf,DROP TABLE,TRUNCATE,git reset --hard, force push lênmain/master/production. - Hành động Guard: ABORT & BLOCK COMMAND.
- Chạy
- Sửa Đổi File Cấu Hình Nền Tảng Trái Phép:
- Tự ý sửa
.env,CONSTITUTION.md, production config, hoặc sửa file DB migration cũ đã commit mà không có Human Authority Override. - Hành động Guard: ABORT & REVERT CHANGES.
- Tự ý sửa
- Kết Nối Trực Tiếp DB Core / Bỏ Qua Adapter:
- Tạo DataSource trực tiếp tới DB Core thay vì đi qua Client Interface / Stored Procedure chuẩn.
- Hành động Guard: ABORT NGAY LẬP TỨC.
- Bọc Lệnh Gọi Mạng 3rd Party trong Database Transaction:
- Mở
@Transactionalbao trùm HTTP RestTemplate/WebClient gọi đối tác (gây chiếm giữ và cạn kiệt HikariCP Connection Pool). - Hành động Guard: ABORT & YÊU CẦU TÁCH TRANSACTION.
- Mở
- Thiếu HTTP Timeout Trên RestTemplate / WebClient:
- Gọi mạng ngoài không cấu hình Connect Timeout (< 3s) và Read Timeout (< 5s).
- Hành động Guard: ABORT VÀ BẮT BUỘC BỔ SUNG TIMEOUT.
- Vi Phạm Giới Hạn Kích Thước Code (Constitution §3):
- Method > 40 dòng, File > 300 dòng, hoặc PR > 400 dòng.
- Hành động Guard: ABORT VÀ YÊU CẦU REFACTOR TÁCH NHỎ.
- Bỏ Quên Idempotency & Validation:
- Endpoint tạo tài khoản, giao dịch tài chính hoặc call e-Contract không có
@Validhoặc thiếu Idempotency key. - Hành động Guard: ABORT NGAY LẬP TỨC.
- Endpoint tạo tài khoản, giao dịch tài chính hoặc call e-Contract không có
- Test Rớt Hoặc Coverage Dưới Ngưỡng (< 80%):
- Chạy test suite có ca thất bại hoặc line coverage < 80%.
- Hành động Guard: ABORT & KHÔNG CHO PHÉP MỞ PR.
📋 QUY TRÌNH GUARD CAN THIỆP KHI PHÁT HIỆN LỖI
Khi phát hiện vi phạm:
- Dừng phiên làm việc hiện tại của Agent.
- In ra mã báo động đỏ:
[STRICT-GUARD-ALARM] VI PHẠM NGUYÊN TẮC BẢO VỆ TỐI THƯỢNG Loại vi phạm : {RULE_NAME} Vị trí file : {FILE_PATH}:{LINE} Mô tả lỗi : {VIOLATION_DESCRIPTION} Trạng thái : EXECUTION HALTED (Dừng hoạt động khẩn cấp) Yêu cầu : Sửa lỗi ngay lập tức hoặc yêu cầu phê duyệt từ Human Lead. - Chỉ tiếp tục sau khi lỗi đã được khắc phục hoàn toàn hoặc có sự phê duyệt từ skill
human-authority-override.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

