@vesviet/agent-skills 5.7.2 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +19 -16
- package/README.md +10 -10
- package/VERSION +1 -1
- package/adapters/antigravity/ANTIGRAVITY.md +88 -3
- package/adapters/antigravity/INDEX_TIER1.json +1287 -0
- package/adapters/antigravity/a2a-config.template.yaml +22 -8
- package/adapters/antigravity/role-skill-index.json +38 -9
- package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
- package/core/contracts/README.md +4 -1
- package/core/contracts/schemas/INDEX.md +7 -1
- package/core/contracts/schemas/a2a-artifact.json +9 -2
- package/core/contracts/schemas/a2a-jsonrpc-envelope.json +7 -2
- package/core/contracts/schemas/a2a-task-progress.json +15 -4
- package/core/contracts/schemas/a2a-task.json +11 -3
- package/core/contracts/schemas/agent-card.json +48 -1
- package/core/contracts/schemas/agent-skills-discovery.json +91 -0
- package/core/contracts/schemas/compliance-report.json +255 -0
- package/core/contracts/schemas/mcp-server-card.json +193 -0
- package/core/contracts/schemas/seo-audit-report.json +3 -5
- package/core/contracts/schemas/seo-content-brief.json +1 -1
- package/core/contracts/schemas/seo-weekly-board.json +1 -1
- package/core/contracts/schemas/series-article.json +1 -1
- package/core/policies/action-boundaries.yaml +324 -1
- package/core/policies/mcp-tool-map.yaml +33 -4
- package/core/roles/3d-graphics-engineer.md +39 -24
- package/core/roles/agent-coordinator.md +73 -43
- package/core/roles/agent-discovery-engineer.md +45 -14
- package/core/roles/ai-systems-engineer.md +24 -10
- package/core/roles/aws-engineer.md +27 -15
- package/core/roles/backend-developer.md +18 -7
- package/core/roles/business-analyst.md +16 -3
- package/core/roles/cloudflare-engineer.md +35 -21
- package/core/roles/content-manager.md +25 -10
- package/core/roles/content-writer.md +55 -42
- package/core/roles/data-analyst.md +16 -3
- package/core/roles/data-engineer.md +15 -2
- package/core/roles/devops-engineer.md +72 -62
- package/core/roles/ecommerce-engineer.md +31 -25
- package/core/roles/frontend-developer.md +20 -11
- package/core/roles/game-developer.md +37 -10
- package/core/roles/mmo-engineer.md +24 -15
- package/core/roles/mobile-engineer.md +76 -61
- package/core/roles/product-manager.md +44 -37
- package/core/roles/project-manager.md +33 -27
- package/core/roles/prompt-engineer.md +32 -4
- package/core/roles/qa-engineer.md +23 -10
- package/core/roles/researcher.md +55 -46
- package/core/roles/reverse-engineer.md +36 -19
- package/core/roles/reviewer.md +20 -5
- package/core/roles/role-standard.md +15 -1
- package/core/roles/sdet.md +32 -2
- package/core/roles/security-engineer.md +39 -22
- package/core/roles/seo-analyst.md +55 -38
- package/core/roles/solution-architect.md +19 -11
- package/core/roles/sre.md +27 -8
- package/core/roles/system-engineer.md +42 -32
- package/core/roles/task-planner.md +42 -30
- package/core/roles/teacher.md +33 -11
- package/core/roles/technical-architect.md +70 -51
- package/core/roles/technical-lead.md +24 -4
- package/core/roles/technical-writer.md +49 -30
- package/core/roles/ui-ux-designer.md +75 -69
- package/core/roles/vietnam-accounting-specialist.md +23 -10
- package/core/roles/vietnam-legal-counsel.md +33 -15
- package/core/skills/README.md +3 -2
- package/core/skills/agent/agent-a2a-protocol/SKILL.md +25 -93
- package/core/skills/agent/architect-mcp-server/SKILL.md +35 -27
- package/core/skills/agent/configure-agent-skills/SKILL.md +60 -68
- package/core/skills/ai/openrouter-task/SKILL.md +86 -0
- package/core/skills/ai/openrouter-task/agents/openai.yaml +5 -0
- package/core/skills/ai-agent/agent-evaluation/resources/eval-benchmarks/eval-cases.json +529 -0
- package/core/skills/ai-agent/agent-evaluation/resources/eval-benchmarks/eval-manifest.yaml +61 -0
- package/core/skills/ai-agent/agent-evaluation/scripts/run-eval-benchmark.py +856 -0
- package/core/skills/ai-agent/agent-evaluation/tests/test_golden_benchmarks.py +248 -0
- package/core/skills/ai-agent/context-optimization/SKILL.md +59 -60
- package/overlays/README.md +1 -1
- package/overlays/security-research/README.md +1 -1
- package/package.json +2 -2
- package/packs/real-estate-team/manifest.yaml +2 -2
- package/overlays/security-research/skills/reverse-engineer-binary/SKILL.md +0 -129
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Automated Golden Benchmark Evaluation Test Suite.
|
|
3
|
+
|
|
4
|
+
Contains 15 unit test methods verifying each golden benchmark evaluation case across:
|
|
5
|
+
- Domain A: A2A v1.0.1+ uppercase state handling (TC-A2A-01 to TC-A2A-04)
|
|
6
|
+
- Domain B: Two-Tier JIT skill discovery accuracy (TC-JIT-01 to TC-JIT-04)
|
|
7
|
+
- Domain C: Stateless MCP prefix policy gating (TC-MCP-01 to TC-MCP-04)
|
|
8
|
+
- Domain D: Prompt prefix cache layer alignment (TC-CACHE-01 to TC-CACHE-03)
|
|
9
|
+
|
|
10
|
+
Executes live Draft 2020-12 schemas, live INDEX_TIER1.json, and live mcp-tool-map.yaml (zero mock facades).
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import importlib.util
|
|
16
|
+
import json
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
import sys
|
|
19
|
+
import unittest
|
|
20
|
+
|
|
21
|
+
import yaml
|
|
22
|
+
|
|
23
|
+
# Dynamically import run-eval-benchmark.py (contains hyphens)
|
|
24
|
+
SKILL_DIR = Path(__file__).resolve().parents[1]
|
|
25
|
+
runner_path = SKILL_DIR / "scripts" / "run-eval-benchmark.py"
|
|
26
|
+
|
|
27
|
+
spec = importlib.util.spec_from_file_location("run_eval_benchmark", runner_path)
|
|
28
|
+
if spec is None or spec.loader is None:
|
|
29
|
+
raise ImportError(f"Could not load runner from {runner_path}")
|
|
30
|
+
run_eval_benchmark = importlib.util.module_from_spec(spec)
|
|
31
|
+
sys.modules["run_eval_benchmark"] = run_eval_benchmark
|
|
32
|
+
spec.loader.exec_module(run_eval_benchmark)
|
|
33
|
+
|
|
34
|
+
BenchmarkEvaluator = run_eval_benchmark.BenchmarkEvaluator
|
|
35
|
+
find_repo_root = run_eval_benchmark.find_repo_root
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class TestGoldenBenchmarks(unittest.TestCase):
|
|
39
|
+
"""Test suite executing the 15 golden evaluation benchmark test cases."""
|
|
40
|
+
|
|
41
|
+
@classmethod
|
|
42
|
+
def setUpClass(cls) -> None:
|
|
43
|
+
cls.repo_root = find_repo_root()
|
|
44
|
+
cls.eval_dir = cls.repo_root / "core" / "skills" / "ai-agent" / "agent-evaluation"
|
|
45
|
+
cls.manifest_path = cls.eval_dir / "resources" / "eval-benchmarks" / "eval-manifest.yaml"
|
|
46
|
+
cls.cases_path = cls.eval_dir / "resources" / "eval-benchmarks" / "eval-cases.json"
|
|
47
|
+
cls.output_path = cls.repo_root / "output" / "agent-eval-report.json"
|
|
48
|
+
|
|
49
|
+
cls.manifest = yaml.safe_load(cls.manifest_path.read_text(encoding="utf-8"))
|
|
50
|
+
cls.cases_data = json.loads(cls.cases_path.read_text(encoding="utf-8"))
|
|
51
|
+
cls.cases_by_id = {c["case_id"]: c for c in cls.cases_data["cases"]}
|
|
52
|
+
|
|
53
|
+
cls.evaluator = BenchmarkEvaluator(
|
|
54
|
+
repo_root=cls.repo_root,
|
|
55
|
+
manifest_path=cls.manifest_path,
|
|
56
|
+
cases_path=cls.cases_path,
|
|
57
|
+
output_path=cls.output_path,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# -------------------------------------------------------------------------
|
|
61
|
+
# Suite Governance & Stratification Tests
|
|
62
|
+
# -------------------------------------------------------------------------
|
|
63
|
+
def test_suite_total_cases_and_stratification(self) -> None:
|
|
64
|
+
"""Verify exactly 15 test cases with 6 Nominal (40%), 6 Edge (40%), 3 Hostile/Safety (20%)."""
|
|
65
|
+
cases = self.cases_data["cases"]
|
|
66
|
+
self.assertEqual(len(cases), 15, "Expected exactly 15 test cases")
|
|
67
|
+
|
|
68
|
+
strat = {"nominal": 0, "edge": 0, "hostile_safety": 0}
|
|
69
|
+
domains = {"a2a_uppercase_state": 0, "jit_skill_discovery": 0, "mcp_prefix_policy": 0, "prompt_prefix_cache": 0}
|
|
70
|
+
|
|
71
|
+
for c in cases:
|
|
72
|
+
tier = c["tier"]
|
|
73
|
+
dom = c["domain"]
|
|
74
|
+
self.assertIn(tier, strat, f"Unknown tier {tier} in {c['case_id']}")
|
|
75
|
+
self.assertIn(dom, domains, f"Unknown domain {dom} in {c['case_id']}")
|
|
76
|
+
strat[tier] += 1
|
|
77
|
+
domains[dom] += 1
|
|
78
|
+
|
|
79
|
+
self.assertEqual(strat["nominal"], 6, "Expected 6 Nominal test cases (40%)")
|
|
80
|
+
self.assertEqual(strat["edge"], 6, "Expected 6 Edge test cases (40%)")
|
|
81
|
+
self.assertEqual(strat["hostile_safety"], 3, "Expected 3 Hostile/Safety test cases (20%)")
|
|
82
|
+
|
|
83
|
+
self.assertEqual(domains["a2a_uppercase_state"], 4, "Domain A must have 4 test cases")
|
|
84
|
+
self.assertEqual(domains["jit_skill_discovery"], 4, "Domain B must have 4 test cases")
|
|
85
|
+
self.assertEqual(domains["mcp_prefix_policy"], 4, "Domain C must have 4 test cases")
|
|
86
|
+
self.assertEqual(domains["prompt_prefix_cache"], 3, "Domain D must have 3 test cases")
|
|
87
|
+
|
|
88
|
+
# -------------------------------------------------------------------------
|
|
89
|
+
# Domain A: A2A v1.0.1+ Uppercase State Handling (TC-A2A-01 to TC-A2A-04)
|
|
90
|
+
# -------------------------------------------------------------------------
|
|
91
|
+
def test_tc_a2a_01_uppercase_state_ingestion(self) -> None:
|
|
92
|
+
"""TC-A2A-01: A2A v1.0.1 Uppercase State Ingestion (TASK_STATE_SUBMITTED)."""
|
|
93
|
+
case = self.cases_by_id["TC-A2A-01"]
|
|
94
|
+
res = self.evaluator.evaluate_a2a_case(case)
|
|
95
|
+
self.assertEqual(res["status"], "passed")
|
|
96
|
+
self.assertEqual(res["score"], 1.0)
|
|
97
|
+
self.assertTrue(res["assertions"]["schema_validation_passed"])
|
|
98
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
99
|
+
|
|
100
|
+
def test_tc_a2a_02_streaming_task_status_update_event(self) -> None:
|
|
101
|
+
"""TC-A2A-02: Streaming TaskStatusUpdateEvent with TASK_STATE_WORKING."""
|
|
102
|
+
case = self.cases_by_id["TC-A2A-02"]
|
|
103
|
+
res = self.evaluator.evaluate_a2a_case(case)
|
|
104
|
+
self.assertEqual(res["status"], "passed")
|
|
105
|
+
self.assertEqual(res["score"], 1.0)
|
|
106
|
+
self.assertTrue(res["assertions"]["schema_validation_passed"])
|
|
107
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
108
|
+
|
|
109
|
+
def test_tc_a2a_03_terminal_task_completion_artifact(self) -> None:
|
|
110
|
+
"""TC-A2A-03: Terminal Task Completion with Artifact Handoff."""
|
|
111
|
+
case = self.cases_by_id["TC-A2A-03"]
|
|
112
|
+
res = self.evaluator.evaluate_a2a_case(case)
|
|
113
|
+
self.assertEqual(res["status"], "passed")
|
|
114
|
+
self.assertEqual(res["score"], 1.0)
|
|
115
|
+
self.assertTrue(res["assertions"]["schema_validation_passed"])
|
|
116
|
+
self.assertTrue(res["assertions"]["must_not_include_passed"])
|
|
117
|
+
|
|
118
|
+
def test_tc_a2a_04_terminal_task_cancellation_lifecycle(self) -> None:
|
|
119
|
+
"""TC-A2A-04: Terminal Task Failure & Cancellation Lifecycle."""
|
|
120
|
+
case = self.cases_by_id["TC-A2A-04"]
|
|
121
|
+
res = self.evaluator.evaluate_a2a_case(case)
|
|
122
|
+
self.assertEqual(res["status"], "passed")
|
|
123
|
+
self.assertEqual(res["score"], 1.0)
|
|
124
|
+
self.assertTrue(res["assertions"]["schema_validation_passed"])
|
|
125
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
126
|
+
|
|
127
|
+
# -------------------------------------------------------------------------
|
|
128
|
+
# Domain B: Two-Tier JIT Skill Discovery Accuracy (TC-JIT-01 to TC-JIT-04)
|
|
129
|
+
# -------------------------------------------------------------------------
|
|
130
|
+
def test_tc_jit_01_api_endpoint_high_confidence_match(self) -> None:
|
|
131
|
+
"""TC-JIT-01: High-Confidence Match for API Endpoint Development (add-api-endpoint)."""
|
|
132
|
+
case = self.cases_by_id["TC-JIT-01"]
|
|
133
|
+
res = self.evaluator.evaluate_jit_case(case)
|
|
134
|
+
self.assertEqual(res["status"], "passed")
|
|
135
|
+
self.assertEqual(res["score"], 1.0)
|
|
136
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
137
|
+
self.assertTrue(res["assertions"]["schema_validation_passed"]) # Digest verified
|
|
138
|
+
|
|
139
|
+
def test_tc_jit_02_vllm_inference_high_confidence_match(self) -> None:
|
|
140
|
+
"""TC-JIT-02: High-Confidence Match for vLLM Inference (deploy-vllm-inference)."""
|
|
141
|
+
case = self.cases_by_id["TC-JIT-02"]
|
|
142
|
+
res = self.evaluator.evaluate_jit_case(case)
|
|
143
|
+
self.assertEqual(res["status"], "passed")
|
|
144
|
+
self.assertEqual(res["score"], 1.0)
|
|
145
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
146
|
+
self.assertTrue(res["assertions"]["schema_validation_passed"]) # Digest verified
|
|
147
|
+
|
|
148
|
+
def test_tc_jit_03_role_prohibited_skill_disqualification(self) -> None:
|
|
149
|
+
"""TC-JIT-03: Active Role Prohibited Skill Disqualification (create-migration)."""
|
|
150
|
+
case = self.cases_by_id["TC-JIT-03"]
|
|
151
|
+
res = self.evaluator.evaluate_jit_case(case)
|
|
152
|
+
self.assertEqual(res["status"], "passed")
|
|
153
|
+
self.assertEqual(res["score"], 1.0)
|
|
154
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
155
|
+
|
|
156
|
+
def test_tc_jit_04_low_confidence_fail_closed_gate(self) -> None:
|
|
157
|
+
"""TC-JIT-04: Low-Confidence Ambiguous Query Fail-Closed Gate (< 0.72)."""
|
|
158
|
+
case = self.cases_by_id["TC-JIT-04"]
|
|
159
|
+
res = self.evaluator.evaluate_jit_case(case)
|
|
160
|
+
self.assertEqual(res["status"], "passed")
|
|
161
|
+
self.assertEqual(res["score"], 1.0)
|
|
162
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
163
|
+
|
|
164
|
+
# -------------------------------------------------------------------------
|
|
165
|
+
# Domain C: Stateless MCP Prefix Policy Gating (TC-MCP-01 to TC-MCP-04)
|
|
166
|
+
# -------------------------------------------------------------------------
|
|
167
|
+
def test_tc_mcp_01_safe_read_prefix_routing(self) -> None:
|
|
168
|
+
"""TC-MCP-01: Dynamic Prefix Routing for Safe Read Operations (^fs_read_.*)."""
|
|
169
|
+
case = self.cases_by_id["TC-MCP-01"]
|
|
170
|
+
res = self.evaluator.evaluate_mcp_case(case)
|
|
171
|
+
self.assertEqual(res["status"], "passed")
|
|
172
|
+
self.assertEqual(res["score"], 1.0)
|
|
173
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
174
|
+
|
|
175
|
+
def test_tc_mcp_02_critical_mutation_prefix_routing(self) -> None:
|
|
176
|
+
"""TC-MCP-02: Dynamic Prefix Routing for Critical Mutation (^db_drop_.*)."""
|
|
177
|
+
case = self.cases_by_id["TC-MCP-02"]
|
|
178
|
+
res = self.evaluator.evaluate_mcp_case(case)
|
|
179
|
+
self.assertEqual(res["status"], "passed")
|
|
180
|
+
self.assertEqual(res["score"], 1.0)
|
|
181
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
182
|
+
|
|
183
|
+
def test_tc_mcp_03_destructive_pattern_precedence(self) -> None:
|
|
184
|
+
"""TC-MCP-03: Destructive Pattern Substring Precedence Over Prefix."""
|
|
185
|
+
case = self.cases_by_id["TC-MCP-03"]
|
|
186
|
+
res = self.evaluator.evaluate_mcp_case(case)
|
|
187
|
+
self.assertEqual(res["status"], "passed")
|
|
188
|
+
self.assertEqual(res["score"], 1.0)
|
|
189
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
190
|
+
|
|
191
|
+
def test_tc_mcp_04_unmapped_tool_fail_closed_fallback(self) -> None:
|
|
192
|
+
"""TC-MCP-04: Unmapped Tool Name Fail-Closed Zero-Trust Fallback."""
|
|
193
|
+
case = self.cases_by_id["TC-MCP-04"]
|
|
194
|
+
res = self.evaluator.evaluate_mcp_case(case)
|
|
195
|
+
self.assertEqual(res["status"], "passed")
|
|
196
|
+
self.assertEqual(res["score"], 1.0)
|
|
197
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
198
|
+
|
|
199
|
+
# -------------------------------------------------------------------------
|
|
200
|
+
# Domain D: Prompt Prefix Cache Layer Alignment (TC-CACHE-01 to TC-CACHE-03)
|
|
201
|
+
# -------------------------------------------------------------------------
|
|
202
|
+
def test_tc_cache_01_six_layer_volatility_hierarchy(self) -> None:
|
|
203
|
+
"""TC-CACHE-01: Deterministic 6-Layer Volatility Hierarchy Compliance."""
|
|
204
|
+
case = self.cases_by_id["TC-CACHE-01"]
|
|
205
|
+
res = self.evaluator.evaluate_cache_case(case)
|
|
206
|
+
self.assertEqual(res["status"], "passed")
|
|
207
|
+
self.assertEqual(res["score"], 1.0)
|
|
208
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
209
|
+
|
|
210
|
+
def test_tc_cache_02_dynamic_header_cache_busting_detection(self) -> None:
|
|
211
|
+
"""TC-CACHE-02: Header Timestamp / Nonce Cache-Busting Detection."""
|
|
212
|
+
case = self.cases_by_id["TC-CACHE-02"]
|
|
213
|
+
res = self.evaluator.evaluate_cache_case(case)
|
|
214
|
+
self.assertEqual(res["status"], "passed")
|
|
215
|
+
self.assertEqual(res["score"], 1.0)
|
|
216
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
217
|
+
|
|
218
|
+
def test_tc_cache_03_deterministic_tool_alphabetical_sorting(self) -> None:
|
|
219
|
+
"""TC-CACHE-03: Deterministic Tool Definition Alphabetical Sorting."""
|
|
220
|
+
case = self.cases_by_id["TC-CACHE-03"]
|
|
221
|
+
res = self.evaluator.evaluate_cache_case(case)
|
|
222
|
+
self.assertEqual(res["status"], "passed")
|
|
223
|
+
self.assertEqual(res["score"], 1.0)
|
|
224
|
+
self.assertTrue(res["assertions"]["must_include_passed"])
|
|
225
|
+
|
|
226
|
+
# -------------------------------------------------------------------------
|
|
227
|
+
# Full Suite Integration & Schema Verification
|
|
228
|
+
# -------------------------------------------------------------------------
|
|
229
|
+
def test_full_suite_execution_and_schema_conformance(self) -> None:
|
|
230
|
+
"""Execute the entire 15-case suite, asserting pass rate and agent-eval-report.json conformance."""
|
|
231
|
+
report = self.evaluator.run_suite()
|
|
232
|
+
summary = report["summary_scores"]
|
|
233
|
+
|
|
234
|
+
self.assertEqual(summary["total_executed"], 15)
|
|
235
|
+
self.assertEqual(summary["passed_count"], 15)
|
|
236
|
+
self.assertEqual(summary["failed_count"], 0)
|
|
237
|
+
self.assertEqual(summary["pass_rate"], 1.0)
|
|
238
|
+
self.assertEqual(summary["verdict"], "passed")
|
|
239
|
+
self.assertEqual(summary["release_gate_recommendation"], "promote")
|
|
240
|
+
self.assertGreaterEqual(summary["overall_score"], 0.85)
|
|
241
|
+
|
|
242
|
+
# Validate emitted report against Draft 2020-12 schema
|
|
243
|
+
errors = self.evaluator.validate_schema("core/contracts/schemas/agent-eval-report.json", report)
|
|
244
|
+
self.assertEqual(len(errors), 0, f"agent-eval-report schema errors: {errors}")
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
if __name__ == "__main__":
|
|
248
|
+
unittest.main()
|
|
@@ -19,83 +19,82 @@ Maximize effective reasoning density in agent context windows by allocating stri
|
|
|
19
19
|
|
|
20
20
|
## Core Rules
|
|
21
21
|
|
|
22
|
+
- **Deterministic 6-Layer Prompt Prefix Caching**:
|
|
23
|
+
To maximize KV cache hit rates (yielding up to 90% read latency and cost reductions), assemble prompts in strict static-to-dynamic volatility order:
|
|
24
|
+
1. *Layer 1: Static System Invariants & Global Rules*: Fixed repository rules, safety constraints, action policies (100% KV cache hit rate across all agents).
|
|
25
|
+
2. *Layer 2: Role Identity & Core Tool Contracts*: Role definition, instructions, and tool definitions deterministically sorted alphabetically by name (Anthropic Breakpoint 1).
|
|
26
|
+
3. *Layer 3: Domain & Repository Architectural Cards*: Knowledge cards, domain boundaries, project layouts (Anthropic Breakpoint 2; shared across repo tasks).
|
|
27
|
+
4. *Layer 4: Session Durable Working State*: Anchored 10-slot state (`compact-working-state.json`), verified decisions, and immutable entity IDs (Anthropic Breakpoint 3).
|
|
28
|
+
5. *Layer 5: Dynamic Turn History with Head-Tail TOC*: Rolling dialogue history and tool outputs compacted via 20% Head / 80% Tail syntax-aware TOC (Anthropic Breakpoint 4 rolling).
|
|
29
|
+
6. *Layer 6: Dynamic Ephemeral Payload*: Current turn user prompt, ephemeral context, and dynamic UTC timestamps (uncached).
|
|
30
|
+
- **Provider-Specific Cache Control Configurations**:
|
|
31
|
+
- *Anthropic*: Explicit ephemeral breakpoints using `cache_control: {"type": "ephemeral", "ttl": "5m" | "1h"}`. Enforce hard ceiling of max 4 breakpoints per request; sequence across `tools` $\rightarrow$ `system` $\rightarrow$ `messages`; minimum 1,024 prefix tokens.
|
|
32
|
+
- *OpenAI*: Automatic caching for prompts $\ge 1,024$ tokens quantized to 128-token boundaries. Use `prompt_cache_key` for sticky cluster routing; track cache telemetry in `usage.prompt_tokens_details.cached_tokens`.
|
|
33
|
+
- *vLLM / SGLang*: Enable server-side prefix caching via `--enable-prefix-caching` and `--block-size 16|32`. Utilizes PagedAttention block alignment and RadixAttention Radix Tree LRU cache reuse.
|
|
34
|
+
- **Cache-Busting Anti-Pattern Mitigations**:
|
|
35
|
+
- *Zero Dynamic Headers*: Never inject dynamic UTC timestamps, random UUIDs, or ephemeral session IDs into Layer 1–3 system headers. Keep dynamic values strictly in Layer 6.
|
|
36
|
+
- *Deterministic Tool Ordering*: Always sort tool definitions alphabetically by name prior to serialization to prevent dictionary key shuffling between turns.
|
|
37
|
+
- *Tenant Salt KV Isolation*: Partition shared cache trees cryptographically using $H_0 = \text{HMAC-SHA256}(\text{TenantID} \parallel \text{Domain}, \text{Salt})$ to prevent cross-tenant cache probing.
|
|
22
38
|
- **Five-Tier Token Budget Allocation**:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
Context capacity must be partitioned into strict deterministic slices:
|
|
40
|
+
1. *System & Behavioral Invariants*: $15\%$ (fixed prompt, role constraints, tool contracts).
|
|
41
|
+
2. *Dynamic Task Grounding*: $35\%$ (task objectives, retrieved references, verified facts).
|
|
42
|
+
3. *Working Memory & Turn History*: $25\%$ (recent tool calls, observations, active state).
|
|
43
|
+
4. *Scratchpad & Intermediate Reasoning*: $10\%$ (scratch notes, plan checklists).
|
|
44
|
+
5. *Output Generation Reserve*: $15\%$ (completion buffer to prevent truncated generations).
|
|
29
45
|
- **Lost-in-the-Middle Priority Ordering**:
|
|
30
|
-
|
|
31
|
-
- *Boundary Placement*: Position mandatory constraints, system instructions, and schema definitions at the very top ($0\%-15\%$).
|
|
32
|
-
- *Recency Placement*: Position current turn objective, active input parameters, and explicit completion format triggers at the very bottom ($85\%-100\%$).
|
|
33
|
-
- *Middle Zone*: Confine secondary reference data, supporting documentation, and historical tool logs to the central window ($15\%-85\%$).
|
|
34
|
-
- **Semantic & Syntactic Deduplication**:
|
|
35
|
-
- Compute sliding 4-gram overlaps across retrieved documents; drop paragraphs with $> 70\%$ verbatim overlap.
|
|
36
|
-
- Apply vector cosine thresholding: if $\text{sim}(e_a, e_b) \ge 0.88$, merge or discard the lower-relevance passage.
|
|
37
|
-
- **Relevance Density Scoring**:
|
|
38
|
-
- Every injected token must contribute directly to task resolution:
|
|
39
|
-
$$\text{Density} = \frac{\text{Entity and Assertion Token Count}}{\text{Total Segment Token Count}}$$
|
|
40
|
-
- Strip markdown decorative wrappers, repeated navigation headers, and verbose boilerplate when density falls below $0.40$.
|
|
46
|
+
Frontier LLMs demonstrate highest attention accuracy at prompt boundaries (primacy and recency). Place mandatory constraints at the top ($0\%-15\%$) and active turn triggers at the bottom ($85\%-100\%$). Confine secondary data to the middle zone ($15\%-85\%$).
|
|
41
47
|
- **Context Engineering 2026 (Anthropic-aligned)**:
|
|
42
48
|
- *Context rot is real*: performance degrades as the window fills with low-value tokens — treat context as a scarce runtime resource, not free capacity.
|
|
43
49
|
- *Compaction over overflow*: near the window limit, summarize the conversation and reinitialize a fresh context; keep raw records with stable identifiers so compaction is recoverable.
|
|
44
|
-
- *
|
|
45
|
-
- *Durable notes over transcript replay*: persist structured notes/memory files
|
|
46
|
-
- *Sub-agent isolation*: dispatch heavy reading to fresh-context sub-agents; return only distilled results to
|
|
50
|
+
- *just-in-time retrieval over pre-loading*: fetch context at the moment of need via tools instead of stuffing everything upfront.
|
|
51
|
+
- *Durable notes over transcript replay*: persist structured notes/memory files outside the window; hydrate new sessions from notes, never full raw transcripts.
|
|
52
|
+
- *Sub-agent isolation*: dispatch heavy reading to fresh-context sub-agents; return only distilled results to orchestrator.
|
|
47
53
|
|
|
48
54
|
## Suggested Process
|
|
49
55
|
|
|
50
|
-
1. **
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
3. **Restructure Passage Sequences**:
|
|
57
|
-
- Reorder retrieved documents: place highest-relevance evidence at the top and immediate query grounding at the bottom.
|
|
58
|
-
- Isolate secondary background material in the middle tier.
|
|
59
|
-
4. **Compress Conversation and Memory Turns**:
|
|
60
|
-
- For dialogues exceeding 8 turns, summarize completed subtask milestones into an immutable context summary.
|
|
61
|
-
- Retain only the last 3 turns of verbatim raw tool invocations and results.
|
|
62
|
-
5. **Verify Context Integrity**:
|
|
63
|
-
- Verify that all schema requirements, critical entity IDs, and active task objectives survived pruning.
|
|
56
|
+
1. **Assemble Prefix Layers 1–3**: Concatenate Static System Invariants, deterministically sorted Role Tools, and Domain Knowledge Cards. Set Provider Cache Breakpoints 1 and 2.
|
|
57
|
+
2. **Hydrate Layer 4 Durable Working State**: Load anchored `compact-working-state.json` notes and set Breakpoint 3.
|
|
58
|
+
3. **Compress Layer 5 History with Head-Tail TOC**: Apply 20% Head / 80% Tail syntax-aware TOC to tool outputs and set Breakpoint 4.
|
|
59
|
+
4. **Append Layer 6 Ephemeral Turn**: Append current user prompt and dynamic UTC timestamp.
|
|
60
|
+
5. **Prune and Deduplicate Ingested Content**: Strip n-gram overlaps ($>70\%$) and apply vector cosine thresholding ($\ge 0.88$).
|
|
61
|
+
6. **Verify Context Integrity**: Confirm critical entity IDs, schema fields, and safety boundaries survived optimization.
|
|
64
62
|
|
|
65
|
-
##
|
|
63
|
+
## Checklist
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
65
|
+
- [ ] 6-layer prefix caching sequence enforced (System -> Role -> Domain -> State -> History -> Ephemeral).
|
|
66
|
+
- [ ] Anthropic ephemeral breakpoints configured (at most 4 breakpoints, ordered tools -> system -> messages).
|
|
67
|
+
- [ ] OpenAI prompts aligned to 128-token boundaries with `prompt_cache_key` sticky routing.
|
|
68
|
+
- [ ] vLLM / SGLang prefix caching enabled with PagedAttention Radix Tree block alignment.
|
|
69
|
+
- [ ] Dynamic UTC timestamps and UUIDs confined strictly to Layer 6 ephemeral payload.
|
|
70
|
+
- [ ] Tool definitions deterministically sorted alphabetically by name.
|
|
71
|
+
- [ ] Token budget partitions configured with $\ge 15\%$ output generation reserve.
|
|
72
|
+
- [ ] Compaction with recoverable raw records replaces blind truncation near window limits.
|
|
73
|
+
- [ ] just-in-time retrieval preferred over pre-loading; durable notes hydrate new sessions.
|
|
74
|
+
- [ ] Essential entity IDs, contracts, and schema requirements verified intact.
|
|
71
75
|
|
|
72
|
-
##
|
|
76
|
+
## Output Contracts
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
- **Aggressive Over-Pruning**: Truncating necessary domain terminology or schema fields during compression. Mitigation: preserve structured contract JSON definitions intact; compress only unstructured prose.
|
|
76
|
-
- **Context Window Thrashing**: Expanding and contracting context dynamically between turns, causing unstable cache hit rates. Mitigation: standardize static prompt prefix boundaries to leverage prefix prompt caching.
|
|
77
|
-
- **Boilerplate Token Bloat**: Passing raw web HTML or unparsed API responses into context. Mitigation: extract pure text and structured data tables prior to prompt assembly.
|
|
78
|
+
When context optimization produces structured task dispatches or plans, emit:
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
- **`contracts/schemas/coordination-plan.json`**: Sliced execution stages respecting token budget allocations and prefix cache boundaries.
|
|
81
|
+
- **`contracts/schemas/compact-working-state.json`**: Anchored 10-slot durable working state preserving verified facts across turns.
|
|
82
|
+
|
|
83
|
+
## Failure Modes
|
|
80
84
|
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
- [ ] Static system prompt prefixes kept stable across turns to maximize prefix caching
|
|
87
|
-
- [ ] Raw JSON and stack traces stripped of redundant whitespace and repeated log lines
|
|
88
|
-
- [ ] Compaction with recoverable raw records replaces blind truncation near window limits
|
|
89
|
-
- [ ] Just-in-time retrieval preferred over pre-loading; durable notes hydrate new sessions instead of transcript replay
|
|
90
|
-
- [ ] Verified that all essential entity IDs, URLs, and contract requirements remain intact
|
|
85
|
+
- **Cache-Busting Prefix Invalidation**: Line-1 dynamic timestamp invalidates KV cache for all downstream tokens. Mitigation: Relocate all volatile timestamps to Layer 6.
|
|
86
|
+
- **Tool Shuffling Invalidation**: Unsorted tool maps yield different token streams each turn. Mitigation: Enforce deterministic alphabetical sorting of tools by name.
|
|
87
|
+
- **Breakpoint Overflow**: Setting $> 4$ Anthropic cache breakpoints causes API rejection. Mitigation: Strict limiter capping breakpoints at 4.
|
|
88
|
+
- **Lost-in-the-Middle Forgetting**: Safety rules placed in center of large context. Mitigation: Anchor rules in Layer 1 and repeat active trigger in Layer 6.
|
|
89
|
+
- **Aggressive Over-Pruning**: Truncating necessary contract schema fields. Mitigation: Keep JSON schemas intact; prune only prose.
|
|
91
90
|
|
|
92
91
|
## Security Guardrails (OWASP ASI)
|
|
93
92
|
|
|
94
|
-
- **ASI01 Goal Hijack**:
|
|
95
|
-
- **ASI04 Supply Chain**:
|
|
96
|
-
- **ASI06 Context & Memory Poisoning**:
|
|
97
|
-
- **ASI07 Inter-Agent Communication**:
|
|
98
|
-
- **ASI09 Human-Agent Trust Exploitation**:
|
|
93
|
+
- **ASI01 Goal Hijack**: Reordering promotes untrusted content to prefix boundary. Mitigation: Keep untrusted inputs confined to Layer 6 inside boundary delimiters.
|
|
94
|
+
- **ASI04 Supply Chain**: Token count mismatch across tokenizer versions. Mitigation: Pin target tokenizer version (cl100k/o200k) and embedding models.
|
|
95
|
+
- **ASI06 Context & Memory Poisoning**: Density scoring strips provenance tags and trust delimiters. Mitigation: Exclude trust wrappers from density pruning.
|
|
96
|
+
- **ASI07 Inter-Agent Communication**: Summarized handoffs passing unverified claims. Mitigation: `coordination-plan.json` must carry only verified facts.
|
|
97
|
+
- **ASI09 Human-Agent Trust Exploitation**: Reporting token savings while truncating schema fields. Mitigation: Complete integrity verification before reporting savings.
|
|
99
98
|
|
|
100
99
|
## Related Skills
|
|
101
100
|
|
package/overlays/README.md
CHANGED
|
@@ -45,7 +45,7 @@ Use an overlay when:
|
|
|
45
45
|
| [data-warehouse](data-warehouse/README.md) | Omnichannel retail platform (DuckDB 1.5+, MISA AMIS, VAS 14, PWA) | DuckDB Single-Writer, MISA AMIS VAS 14 voucher splitting, blind recount physical stocktaking, Decree 13/2023/ND-CP PII masking, plus `learning/` data-engineering track (merged from `data-engineer-learning`: Iceberg, dbt 1.9, Kafka, Spark) |
|
|
46
46
|
| [cad-projection](cad-projection/README.md) | Computer-Aided Design (CAD) & technical drawing | Millimeter coordinate system ($1\text{ unit} = 1\text{mm}$), Landscape A3 sheet, 4-tier ISO stroke hierarchy, $\pm 30^\circ$ isometric projection matrix, `isometric-svg-projection` skill |
|
|
47
47
|
| [fintech-compliance](fintech-compliance/README.md) | Financial technology & credit risk modeling | Basel/Fair Lending compliance, monotonic Weight of Evidence (WOE) binning, Information Value (IV) thresholds, scorecard point scaling (PDO), Population Stability Index (PSI) drift monitoring, `build-credit-scorecard` skill |
|
|
48
|
-
| [security-research](security-research/README.md) | Binary analysis & security research | Ethical and legal boundaries, Tier 2/3 container/microVM sandbox isolation, decompiler triage coordination (Ghidra, radare2, Electron unpackers), REA evidence ledger
|
|
48
|
+
| [security-research](security-research/README.md) | Binary analysis & security research | Ethical and legal boundaries, Tier 2/3 container/microVM sandbox isolation, decompiler triage coordination (Ghidra, radare2, Electron unpackers), REA evidence ledger (`reverse-engineer-binary` core skill) |
|
|
49
49
|
|
|
50
50
|
## 2026 Critical Migration Notes
|
|
51
51
|
|
|
@@ -16,7 +16,7 @@ This overlay establishes strict ethical and legal boundaries, Tier 2/3 sandbox c
|
|
|
16
16
|
## Included
|
|
17
17
|
|
|
18
18
|
- `rules/reverse-engineering-rules.md` — Ethical boundaries, sandbox containment, and evidence logging rules
|
|
19
|
-
- `skills/reverse-engineer-binary/SKILL.md` — Binary disassembly, decompilation, and REA ledger skill
|
|
19
|
+
- Uses core skill `core/skills/security-data/reverse-engineer-binary/SKILL.md` — Binary disassembly, decompilation, and REA ledger skill
|
|
20
20
|
|
|
21
21
|
## Activation
|
|
22
22
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesviet/agent-skills",
|
|
3
|
-
"version": "5.
|
|
4
|
-
"description": "Engineering skill pack for AI-assisted delivery: 183 skills, 39 roles, 25 workflows,
|
|
3
|
+
"version": "5.8.0",
|
|
4
|
+
"description": "Engineering skill pack for AI-assisted delivery: 183 skills, 39 roles, 25 workflows, 63 data contracts, with a CLI to install skills into your agent platform.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
@@ -2,7 +2,7 @@ schema_version: "2"
|
|
|
2
2
|
|
|
3
3
|
name: real-estate-team
|
|
4
4
|
display_name: Real Estate Content & SEO Team
|
|
5
|
-
description: High-authority content engineering and SEO publishing pack for Real Estate Portal (https://real-estate.example.com - Astro v5 + Cloudflare Pages). Composes portable core with overlays/real-estate-content and overlays/seo-publishing. Enforces the 5-Pillar Housing Content Framework (Intelligence, Information, Insights, Neighborhoods, Integration), 2026/2027 GEO/AEO standards (<AnswerFirst> component, fact density >=3 points/500w, anti-slop gating), 8-batch empirical AEO upgrade discipline,
|
|
5
|
+
description: High-authority content engineering and SEO publishing pack for Real Estate Portal (https://real-estate.example.com - Astro v5 + Cloudflare Pages). Composes portable core with overlays/real-estate-content and overlays/seo-publishing. Enforces the 5-Pillar Housing Content Framework (Intelligence, Information, Insights, Neighborhoods, Integration), 2026/2027 GEO/AEO standards (<AnswerFirst> component, fact density >=3 points/500w, anti-slop gating), 8-batch empirical AEO upgrade discipline, 17-persona E-E-A-T authorship (133 frontmatter aliases), property-post cross-linking (61 luxury portfolios x 482 guides), and a 4-role multi-agent delivery pipeline.
|
|
6
6
|
version: 5.0.0
|
|
7
7
|
|
|
8
8
|
tags:
|
|
@@ -78,7 +78,7 @@ corpus:
|
|
|
78
78
|
empirical_batches_completed: 8
|
|
79
79
|
posts_at_masterclass: 100
|
|
80
80
|
answerfirst_coverage: "482/482"
|
|
81
|
-
author_registry_personas:
|
|
81
|
+
author_registry_personas: 17
|
|
82
82
|
indexes:
|
|
83
83
|
- real-estate/plan/CONTENT_INDEX.md
|
|
84
84
|
- real-estate/plan/LAW_CONTENT_INDEX_AND_AUDIT_2026.md
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: reverse-engineer-binary
|
|
3
|
-
description: Use when deconstructing compiled binaries, Electron bundles, and firmware images in air-gapped sandboxes to produce structured REA evidence ledgers.
|
|
4
|
-
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_build, execute_command, run_tests]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Reverse Engineer Binary
|
|
8
|
-
|
|
9
|
-
Deconstruct compiled executables, Electron packages, and firmware images in air-gapped sandboxes using Ghidra, radare2, and unpacking toolchains to generate verifiable REA evidence ledgers.
|
|
10
|
-
|
|
11
|
-
## When to Use
|
|
12
|
-
|
|
13
|
-
- Auditing third-party compiled binaries or closed-source dependencies for security vulnerabilities
|
|
14
|
-
- Unpacking Electron desktop bundles (`.asar`) to inspect embedded JavaScript application logic
|
|
15
|
-
- Extracting hardcoded API tokens, cryptographic credentials, and network endpoints from executables
|
|
16
|
-
- Triage of suspicious binaries, malicious firmware blobs, or supply-chain drop-in libraries
|
|
17
|
-
- Producing defensible Reverse Engineering Artifact (REA) evidence reports for security audits
|
|
18
|
-
|
|
19
|
-
## Core Rules
|
|
20
|
-
|
|
21
|
-
- **Defensive Ethics Invariant**: Reverse engineering is restricted strictly to vulnerability discovery, defensive auditing, malware analysis, and interoperability research. DRM circumvention, license key generation, and exploit authoring are strictly prohibited.
|
|
22
|
-
- **Source Code Presence Guard**: If readable source code is present in the repository, bypass this reverse engineering skill entirely and audit source code directly using standard code analysis tools.
|
|
23
|
-
- **Mandatory Sandbox Confinement**: Never execute or decompile untrusted binaries directly on the host machine. All analysis must execute inside Tier 2 (hardened OCI/gVisor container with `--read-only`, `--network=none`, `CAP_DROP=ALL`) or Tier 3 (Firecracker microVM).
|
|
24
|
-
- **Network Air-Gap**: The analysis environment must have `--network=none` active at all times. Network egress during binary inspection is strictly forbidden.
|
|
25
|
-
- **Triage Toolchain Hierarchy**:
|
|
26
|
-
- Electron / JS packages: Unpack using `asar` and run static AST analysis
|
|
27
|
-
- Native binaries: Run static header triage, strings extraction (`rabin2 -z`), symbol recovery (`rabin2 -i`), followed by headless Ghidra or radare2 decompilation
|
|
28
|
-
- **Verifiable REA Ledger**: Every analysis must produce a structured REA evidence ledger recording artifact hashes, decompiler tool versions, discovered entry points, and vulnerability findings.
|
|
29
|
-
|
|
30
|
-
## Suggested Process
|
|
31
|
-
|
|
32
|
-
### 1. Ingest Artifact and Verify Boundaries
|
|
33
|
-
- Compute cryptographic checksums: SHA-256 and MD5 hashes of target binary artifact.
|
|
34
|
-
- Check repository context for human-readable source code; if source exists, abort reverse engineering and switch to source code review.
|
|
35
|
-
- Confirm target scope aligns with defensive audit, vulnerability research, or supply chain verification.
|
|
36
|
-
|
|
37
|
-
### 2. Initialize Air-Gapped Sandbox Environment
|
|
38
|
-
- Launch Tier 2 hardened OCI container with read-only root (`--read-only`), dropped capabilities (`--cap-drop=ALL`), non-root UID (`10001:10001`), and network air-gap (`--network=none`).
|
|
39
|
-
- Mount target binary into sandboxed scratch workspace with `noexec` flags when performing static disassembly.
|
|
40
|
-
- Set process limits (memory $\le 2\text{GB}$, CPU $\le 2.0$, PIDs $\le 64$).
|
|
41
|
-
|
|
42
|
-
### 3. Conduct Decompiler Triage
|
|
43
|
-
- **For Electron / Node packages**:
|
|
44
|
-
- Execute `npx asar extract <file>.asar <dest_dir>` to recover source tree.
|
|
45
|
-
- Review `package.json` dependencies and scan JS code for dynamic `eval` or remote script loaders.
|
|
46
|
-
- **For Native Binaries (ELF, PE, Mach-O)**:
|
|
47
|
-
- Run binary header classification (`file`, `rabin2 -I`) to determine architecture, bitness, and section entropy.
|
|
48
|
-
- Extract ASCII and UTF-16 strings (`rabin2 -z`, `rabin2 -zz`) to locate URLs, IPs, file paths, and credentials.
|
|
49
|
-
- Map external imports (`rabin2 -i`) and exported symbols (`rabin2 -E`) to understand system call surfaces.
|
|
50
|
-
- Launch headless Ghidra script or radare2 (`r2 -c 'aaa; pdc'`) on target function addresses.
|
|
51
|
-
|
|
52
|
-
### 4. Synthesize REA Evidence Ledger
|
|
53
|
-
- Record binary metadata: filename, byte size, SHA-256 hash, architecture, compiler signature, and packing status.
|
|
54
|
-
- Document discovered entry points, API call sequences, and cryptographic constants.
|
|
55
|
-
- Detail identified vulnerabilities with memory offset addresses, assembly snippets, and CWE/CVSS classifications.
|
|
56
|
-
- Formulate actionable defensive mitigations and patch recommendations.
|
|
57
|
-
|
|
58
|
-
### 5. Review Findings and Secure Cleanup
|
|
59
|
-
- Validate that all findings are accompanied by exact binary offsets and decompiled evidence snippets.
|
|
60
|
-
- Ensure the ephemeral sandbox container is terminated and temporary scratch volumes are purged.
|
|
61
|
-
|
|
62
|
-
## Output Format
|
|
63
|
-
|
|
64
|
-
Outputs must format the analysis results into a structured REA evidence ledger:
|
|
65
|
-
|
|
66
|
-
```markdown
|
|
67
|
-
# <Artifact Name> - Reverse Engineering Evidence Ledger
|
|
68
|
-
|
|
69
|
-
## Artifact Identification
|
|
70
|
-
- Filename: <binary_name> | Byte Size: <bytes>
|
|
71
|
-
- SHA-256: <64-character-hex-hash>
|
|
72
|
-
- Architecture: <e.g. x86_64, ARM64, WebAssembly>
|
|
73
|
-
- Compiler / Packer: <detected toolchain or "Unpacked">
|
|
74
|
-
|
|
75
|
-
## Environment & Provenance
|
|
76
|
-
- Sandbox Tier: Tier 2 (OCI / gVisor) | Network: Air-gapped (--network=none)
|
|
77
|
-
- Toolchain: Ghidra Headless <version> / radare2 <version>
|
|
78
|
-
|
|
79
|
-
## Attack Surface Inventory
|
|
80
|
-
- Imported Libraries: <list of DLLs or shared objects>
|
|
81
|
-
- Sensitive Strings / Endpoints: <extracted URLs, IPs, paths>
|
|
82
|
-
- Exported API Surface: <callable functions>
|
|
83
|
-
|
|
84
|
-
## Vulnerability & Defect Matrix
|
|
85
|
-
| Offset | Category | Severity | Root Cause | Remediation |
|
|
86
|
-
| :--- | :--- | :--- | :--- | :--- |
|
|
87
|
-
| `0x004012A0` | CWE-120 Buffer Overflow | High (CVSS 7.8) | Unbounded `strcpy` | Replace with bounded copy |
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Failure Modes
|
|
91
|
-
|
|
92
|
-
- **Host execution leak**: Running an untrusted binary or dynamic tracer outside a sandbox risks host compromise. **Mitigation**: Strictly mandate Tier 2/3 container isolation with dropped capabilities and noexec mounts.
|
|
93
|
-
- **Decompiling existing source code**: Spending agent compute reverse engineering binaries when source code is already present. **Mitigation**: Enforce Source Code Presence Guard in step 1.
|
|
94
|
-
- **Network egress during analysis**: Decompilation toolchains phoning home or triggering network beacons embedded in malware. **Mitigation**: Enforce `--network=none` air-gap at the container runtime level.
|
|
95
|
-
- **Unverified assembly assertions**: Stating a binary is vulnerable without providing exact offset addresses and instruction disassembly. **Mitigation**: Require proof offsets in the REA evidence ledger.
|
|
96
|
-
|
|
97
|
-
## Output Contracts
|
|
98
|
-
|
|
99
|
-
When completing binary analysis or decompilation triage, emit:
|
|
100
|
-
|
|
101
|
-
- Structured REA evidence ledger markdown document following the Output Format template.
|
|
102
|
-
- If reporting security vulnerabilities, companion artifact must adhere to `contracts/schemas/security-audit.json`.
|
|
103
|
-
|
|
104
|
-
## Security Guardrails (OWASP ASI)
|
|
105
|
-
|
|
106
|
-
- **ASI05 Sandbox Escape Guard**: Never enable Docker socket forwarding or privileged container flags (`--privileged`) during reverse engineering tasks.
|
|
107
|
-
- **ASI06 Binary Data Guard**: Do not output raw unescaped binary bytes or shellcode sequences into user-facing chat logs.
|
|
108
|
-
|
|
109
|
-
## Checklist
|
|
110
|
-
|
|
111
|
-
- [ ] Defensive audit or vulnerability research authorization confirmed.
|
|
112
|
-
- [ ] Source code presence checked; skipped reverse engineering if source code is present.
|
|
113
|
-
- [ ] Cryptographic hashes (SHA-256 and MD5) calculated and recorded.
|
|
114
|
-
- [ ] Tier 2/3 sandbox container initialized with `--read-only` and `CAP_DROP=ALL`.
|
|
115
|
-
- [ ] Network air-gap verified active (`--network=none`).
|
|
116
|
-
- [ ] Binary architecture, compiler signature, and entropy evaluated.
|
|
117
|
-
- [ ] Sensitive strings, URLs, IPs, and API keys extracted and cataloged.
|
|
118
|
-
- [ ] Dynamic library imports and exported symbol tables mapped.
|
|
119
|
-
- [ ] Critical functions decompiled using headless Ghidra or radare2.
|
|
120
|
-
- [ ] REA evidence ledger populated with exact memory offsets and remediation advice.
|
|
121
|
-
- [ ] Ephemeral sandbox container destroyed upon completion.
|
|
122
|
-
|
|
123
|
-
## Related Skills
|
|
124
|
-
|
|
125
|
-
- **security-audit**: Conduct end-to-end vulnerability assessments and CVSS scoring
|
|
126
|
-
- **supply-chain-security**: Verify dependencies, signatures, and package hashes
|
|
127
|
-
- **manage-secrets**: Isolate, rotate, and secure leaked API keys or credentials found in binaries
|
|
128
|
-
- **systematic-debugging**: Formulate testable hypotheses when tracing control flow defects
|
|
129
|
-
- **review-code**: Audit decompiled C/C++ pseudo-code or unpacked JavaScript for security flaws
|