Forensify
alexgreensh/repo-forensics
Cross-agent self-inspection of your AI-agent stack. An agent skill from alexgreensh/repo-forensics.
MCP gateway security patterns, token management, request validation, and audit logging for MCP communications
$ npx skills add Hack23/cia --skill mcp-gateway-security -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Hack23/cia mcp-gateway-security --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/mcp-gateway-security .claude/skills/mcp-gateway-security && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "mcp-gateway-security" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/mcp-gateway-security into .claude/skills/mcp-gateway-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcp-gateway-security", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Hack23/cia/tree/master/.github/skills/mcp-gateway-securityType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Hack23/cia --skill mcp-gateway-security -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Hack23/cia mcp-gateway-security --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/mcp-gateway-security .agents/skills/mcp-gateway-security && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "mcp-gateway-security" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/mcp-gateway-security into .agents/skills/mcp-gateway-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcp-gateway-security", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Hack23/cia --skill mcp-gateway-security -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Hack23/cia mcp-gateway-security --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/mcp-gateway-security .cursor/skills/mcp-gateway-security && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "mcp-gateway-security" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/mcp-gateway-security into .cursor/skills/mcp-gateway-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcp-gateway-security", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Hack23/cia.git --path .github/skills/mcp-gateway-security--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Hack23/cia --skill mcp-gateway-security -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Hack23/cia mcp-gateway-security --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/mcp-gateway-security .gemini/skills/mcp-gateway-security && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "mcp-gateway-security" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/mcp-gateway-security into .gemini/skills/mcp-gateway-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcp-gateway-security", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Hack23/cia mcp-gateway-securityInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Hack23/cia --skill mcp-gateway-security -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/mcp-gateway-security .github/skills/mcp-gateway-security && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "mcp-gateway-security" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/mcp-gateway-security into .github/skills/mcp-gateway-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcp-gateway-security", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Hack23/cia --skill mcp-gateway-security -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Hack23/cia mcp-gateway-security --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/mcp-gateway-security .opencode/skills/mcp-gateway-security && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "mcp-gateway-security" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/mcp-gateway-security into .opencode/skills/mcp-gateway-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcp-gateway-security", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
mcp-gateway-securityMCP gateway security patterns, token management, request validation, and audit logging for MCP communications
MCP Gateway Security is an agent skill from Hack23/cia. MCP gateway security patterns, token management, request validation, and audit logging for MCP communications
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Security, covering MCP servers and Threat modeling. It works with Model Context Protocol. The repository describes itself as: Citizen Intelligence Agency. Open-source intelligence platform analyzing Swedish political activities using AI and data visualization. Tracks politicians, government… The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 6a9797b. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are json).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
modelcontextprotocol.ioowasp.orgdocs.github.comgithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
GITHUB_TOKENFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
MCP Gateway Security loads about 2.4k tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 525 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from Hack23/cia at commit 6a9797b, republished under its Apache-2.0 licence (© Hack23). 525 words, ~2,388 tokens.
.claude/skills/mcp-gateway-security/SKILL.md (or your agent's skills folder).This skill provides security patterns and best practices for securing MCP (Model Context Protocol) gateway communications in the CIA platform. It covers token management, request validation, audit logging, and threat mitigation for AI-assisted development workflows.
Apply this skill when:
Do NOT use for:
┌──────────────────────────────────────────────┐
│ Threat Vectors │
├──────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌────────┐ │
│ │ Token │ │ Prompt │ │ Supply │ │
│ │ Theft │ │ Injection│ │ Chain │ │
│ └────┬─────┘ └────┬─────┘ └───┬────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ MCP Gateway │ │
│ └────┬────────────┬────────────┬──────────┘ │
│ │ │ │ │
│ ┌────▼────┐ ┌────▼────┐ ┌───▼─────┐ │
│ │ Unauth │ │ Data │ │ Lateral │ │
│ │ Access │ │ Exfil │ │ Movement│ │
│ └─────────┘ └─────────┘ └─────────┘ │
└──────────────────────────────────────────────┘| Threat | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Token theft from config | Medium | Critical | Environment variables, secret managers |
| Prompt injection via tools | Medium | High | Input validation, output sanitization |
| Supply chain attack on MCP packages | Low | Critical | Version pinning, integrity checks |
| Unauthorized file access | Medium | High | Directory restrictions, least privilege |
| Data exfiltration via MCP tools | Low | High | Output monitoring, allowed destinations |
| Privilege escalation | Low | Critical | Role-based access, capability limits |
| Requirement | Implementation | Priority |
|---|---|---|
| No hardcoded tokens | Environment variables only | Critical |
| Token rotation | Regular rotation schedule | High |
| Least privilege scopes | Minimal required permissions | Critical |
| Token encryption at rest | OS keychain or secret manager | High |
| Token audit trail | Log token usage, not values | Medium |
{
"mcpServers": {
"github": {
"type": "stdio",
"command": "github-mcp-server",
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}Token Handling Rules:
✅ DO: Use environment variable references (${VAR_NAME})
✅ DO: Use GitHub Actions secrets for CI/CD tokens
✅ DO: Rotate tokens at least quarterly
✅ DO: Use fine-grained PATs with minimal scopes
✅ DO: Revoke tokens immediately when compromised
❌ DON'T: Hardcode tokens in configuration files
❌ DON'T: Commit tokens to version control
❌ DON'T: Share tokens between environments
❌ DON'T: Use classic PATs with broad scopes
❌ DON'T: Log token values in any log output| MCP Operation | Required Scope | Justification |
|---|---|---|
| Read code | contents:read | Code search and file reading |
| Create PRs | pull_requests:write | PR creation and updates |
| Manage issues | issues:write | Issue creation and updates |
| Read workflows | actions:read | CI/CD status checking |
| Security alerts | security_events:read | CodeQL and Dependabot |
File Operations:
Validation Rules:
1. Path must be within allowed directories
2. Path must not contain traversal sequences (../)
3. File extension must be in allowed list
4. File size must not exceed limits
5. Content must not contain known malicious patternsCode Operations:
Validation Rules:
1. Branch names must match allowed pattern
2. Commit messages must not contain secrets
3. File content must pass security scanning
4. PR descriptions must not leak sensitive dataBefore Returning MCP Tool Output:
1. Strip any credential-like patterns
2. Remove internal IP addresses/hostnames
3. Truncate excessively large outputs
4. Validate JSON/structured output format
5. Log sanitization actions for audit| Tool | Risk | Mitigation |
|---|---|---|
filesystem.write_file | Overwrite critical files | Restrict to project directories |
filesystem.delete | Data loss | Require confirmation, backup |
github.push_files | Inject malicious code | Code review before merge |
playwright.evaluate | Execute arbitrary JS | Sandbox, restrict domains |
bash.execute | System command execution | Allowlist commands, sandbox |
| Event | Log Level | Data to Capture |
|---|---|---|
| MCP server start/stop | INFO | Server name, timestamp |
| Tool invocation | INFO | Tool name, parameters (sanitized) |
| Authentication success | INFO | Server name, token type (not value) |
| Authentication failure | WARN | Server name, failure reason |
| Access denied | WARN | Tool, resource, reason |
| Configuration change | INFO | What changed, who changed it |
| Error/exception | ERROR | Error details, stack trace |
❌ Token values or API keys
❌ File contents containing secrets
❌ User passwords or credentials
❌ Full request/response bodies with PII
❌ Internal network topology details{
"timestamp": "2024-01-15T10:30:00Z",
"event": "mcp.tool.invocation",
"server": "github",
"tool": "create_pull_request",
"parameters": {
"owner": "Hack23",
"repo": "cia",
"title": "[REDACTED]"
},
"result": "success",
"duration_ms": 1250,
"user": "copilot-agent"
}□ All tokens use environment variables (never hardcoded)
□ Token scopes follow least privilege
□ Filesystem access restricted to project directory only
□ MCP package versions pinned to specific releases
□ Configuration file committed (without secrets)
□ No sensitive data in MCP server arguments
□ SSE server URLs use HTTPS only
□ Certificate validation enabled for remote servers□ Review token scopes — remove unnecessary permissions
□ Rotate tokens per schedule
□ Check for new MCP package versions and CVEs
□ Review audit logs for anomalies
□ Verify directory restrictions still appropriate
□ Test authentication failure handling
□ Review and update threat model
□ Check for deprecated MCP server versionsMCP Security Incident
│
├─→ Token Compromise
│ ├─→ Revoke token immediately
│ ├─→ Rotate all related tokens
│ ├─→ Review audit logs for unauthorized access
│ └─→ Update token storage mechanism
│
├─→ Unauthorized File Access
│ ├─→ Review filesystem server configuration
│ ├─→ Check for directory traversal attempts
│ ├─→ Restrict filesystem paths
│ └─→ Review accessed files for data exposure
│
├─→ Supply Chain Attack
│ ├─→ Pin to known-good version
│ ├─→ Verify package integrity
│ ├─→ Check for malicious tool behavior
│ └─→ Report to MCP package maintainers
│
└─→ Prompt Injection
├─→ Review tool invocation logs
├─→ Identify injected content
├─→ Assess data exposure
└─→ Update input validation rules| OWASP Agentic Risk | MCP Mitigation |
|---|---|
| Excessive Agency | Restrict tool capabilities, require confirmation |
| Tool Misuse | Input validation, output monitoring |
| Privilege Escalation | Least privilege tokens, capability limits |
| Data Leakage | Output sanitization, logging controls |
| Insecure Output | Validate all MCP tool responses |
| Supply Chain | Pin versions, verify integrity |
| Security Area | ISO 27001 | NIST CSF | CIS Controls |
|---|---|---|---|
| Token Management | A.8.24, A.5.17 | PR.DS-1 | CIS 3.11 |
| Access Control | A.8.3, A.8.5 | PR.AC-4 | CIS 6.1 |
| Audit Logging | A.8.15 | DE.AE-3 | CIS 8.2 |
| Input Validation | A.8.28 | PR.IP-12 | CIS 16.1 |
| Configuration Mgmt | A.8.9 | PR.IP-1 | CIS 4.1 |
| Incident Response | A.5.24-A.5.27 | RS.MA-1 | CIS 17.1 |
© Hack23, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .github/skills/mcp-gateway-security of Hack23/cia.
Open the folder on GitHubat commit 6a9797b
MCP Gateway Security next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| MCP Gateway Security this skillHack23/cia | 239 | — | ~2.4k | Automated safety check: Pass | Apache-2.0 | |
| Forensifyalexgreensh/repo-forensics | 187 | — | ~2.5k | Automated safety check: Notes | Custom licence | |
| Securing AI Systemstrilwu/secskills | 156 | — | ~2.9k | Automated safety check: Pass | MIT | |
| Plugin Scanneriflytek/skillhub | 5.2k | 2 repos | ~1.1k | Automated safety check: Notes | Apache-2.0 | |
| Webcrypt MCPputervision/state-memory-mcp | 111 | — | ~847 | Automated safety check: Pass | MIT | |
| Security Passcyanheads/pubmed-mcp-server | 154 | — | ~6.4k | Automated safety check: Pass | Apache-2.0 |
alexgreensh/repo-forensics
Cross-agent self-inspection of your AI-agent stack. An agent skill from alexgreensh/repo-forensics.
trilwu/secskills
Assess and harden LLM applications and agentic systems against prompt injection, tool misuse, excessive agency, memory poisoning, RAG data leakage, and model supply-chain risk, mapped to the OWASP…
iflytek/skillhub
Scan AI agent skills, plugins, MCP servers, and agent tooling for prompt injection, unsafe commands, secret exposure, and supply-chain risks before installing or trusting them.
putervision/state-memory-mcp
Teaches the agent to use the WebCrypt MCP server for AES-256-GCM symmetric encryption, RSA-4096 hybrid encryption, key generation, digital signatures, hashing, and post-quantum cryptography.
cyanheads/pubmed-mcp-server
Review an MCP server for common security gaps: LLM-facing surfaces as injection vector (tools, resources, prompts, descriptions), scope blast radius, destructive ops without consent, upstream auth…
LeoYeAI/openclaw-master-skills
MCP server security registry and trust assessment — look up servers in the 427+ server security metadata registry, run pre-install marketplace checks, batch fleet risk scoring, assess skill file…
Hack23/cia
WCAG 2.1 AA compliance, ARIA attributes, keyboard navigation, screen reader optimization for accessible political data platforms
Hack23/cia
Advanced chart types, D3.js/Vaadin Charts patterns, political data visualization, time series analysis
Hack23/cia
AI governance, EU AI Act compliance, OWASP LLM security, responsible AI practices for GitHub Copilot agents
Hack23/cia
External API integration patterns, retry logic, circuit breakers, caching, rate limiting for government data APIs
Hack23/cia
AWS CloudWatch metrics, alarms, dashboards, log insights, and application monitoring for the CIA platform
Hack23/cia
AWS security best practices, VPC security, IAM, KMS, CloudTrail, GuardDuty for CIA platform deployment
Works with
Categories
MCP gateway security patterns, token management, request validation, and audit logging for MCP communications. MCP Gateway Security is an agent skill from Hack23/cia.
MCP Gateway Security fits situations like: tasks that involve MCP servers; tasks that involve Threat modeling.
Run `npx skills add Hack23/cia --skill mcp-gateway-security -a claude-code`. Or copy the skill folder (.github/skills/mcp-gateway-security in Hack23/cia) into .claude/skills/mcp-gateway-security in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Hack23/cia --skill mcp-gateway-security -a codex`. Or copy the skill folder (.github/skills/mcp-gateway-security in Hack23/cia) into .agents/skills/mcp-gateway-security in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Hack23/cia --skill mcp-gateway-security -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mcp-gateway-security, .gemini/skills/mcp-gateway-security, .github/skills/mcp-gateway-security and .opencode/skills/mcp-gateway-security in your project.
Going by SKILL.md and its folder, MCP Gateway Security needs credentials named GITHUB_TOKEN. Our summary lists: A credential in GITHUB_TOKEN.
SKILL.md names 4 domains. As links in the text: modelcontextprotocol.io, owasp.org, docs.github.com and github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
MCP Gateway Security is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with MCP Gateway Security: Forensify (alexgreensh/repo-forensics, 187 stars), Securing AI Systems (trilwu/secskills, 156 stars), Plugin Scanner (iflytek/skillhub, 5.2k stars) and Webcrypt MCP (putervision/state-memory-mcp, 111 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Hack23 (a GitHub organization) maintains it in Hack23/cia, which has 239 GitHub stars. The repository holds 78 skills in this directory. The repository was last updated on October 6, 2026.
Source: Hack23/cia on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.