Ai Systems Securityのロゴ

Ai Systems Security

組織
RedHatProductSecurity
ai-systems-security

Secure AI-powered products and infrastructure. Use when integrating LLM APIs, deploying model-serving infrastructure, building agent workflows, connecting MCP servers, or reviewing AI system architecture for security gaps.

概要

公開者RedHatProductSecurity
リポジトリprodsec-skills
スキル名ai-systems-security
スター
56
フォーク
9
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    RedHatProductSecurityがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Ai Systems Security」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/RedHatProductSecurity/prodsec-skills/tree/main/ge-core/ai-systems-security
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/RedHatProductSecurity/prodsec-skills.git /tmp/prodsec-skills
mkdir -p .claude/skills
cp -r /tmp/prodsec-skills/ge-core/ai-systems-security .claude/skills/ai-systems-security
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでAi Systems Securityを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にAi Systems Securityを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Ai Systems Securityは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

AI Systems Security

Security guidance for teams that serve, integrate, or operate LLMs and AI agents — not for teams training or fine-tuning models. Covers the attack surface introduced when products call LLM APIs, run agent workflows, or expose tool servers.

When to Use

  • Integrating an LLM API (OpenAI, Anthropic, self-hosted) into a product
  • Deploying model-serving infrastructure (OpenShift AI, RHOAI, vLLM)
  • Building or reviewing agent workflows that take actions on behalf of users
  • Connecting MCP servers to agents or LLM-powered features
  • Reviewing AI system architecture for security gaps

When NOT to Use

  • Reviewing AI-generated code for correctness (use ai-code-review)
  • General web application security without AI components (use web-application-security)
  • Container hardening without AI-specific concerns (use container-hardening)

1. Secure LLM Integration

Third-party model providers

  • Obtain information security approval for each provider before integration
  • All connections MUST use TLS — never send prompts or receive responses over unencrypted channels
  • Never hardcode API keys in source code, commit them to version control, or bake them into container images
  • Store credentials in secret management systems (Vault, Kubernetes Secrets) or inject via environment variables at runtime
  • Rotate API credentials on a regular schedule and monitor usage for unexpected patterns
Credential storage:
  FORBIDDEN: Hardcoded in source, committed to git, baked in images
  REQUIRED:  Secret management (Vault, K8s Secrets) or env vars injected at runtime

Self-hosted models

  • Scan models for malicious code before loading — avoid unsafe serialization formats (pickle) that execute code on deserialization; prefer SafeTensors
  • Verify model provenance and integrity (signatures, checksums) before deployment
  • Isolate model-serving processes with dedicated service accounts and restricted network access

2. Prompt Injection Defense

Prompt injection cannot be fully prevented by any single control. Use layered defense:

Rate Limiting → Input Guardrails → Safer Model → Output Guardrails → Sandbox

Input guardrails (user → model)

  • Block known injection patterns and adversarial prompts
  • Mask PII and credentials before they reach the model
  • Enforce input length limits and rate limiting per user/client

Output guardrails (model → user)

  • Block harmful, policy-violating, or data-leaking content
  • Mask sensitive information the model may have surfaced from training data
  • Validate model-generated actions before execution (see Section 6)

Model selection

  • Prefer models with published safety benchmarks, alignment training (RLHF/Constitutional AI), and disclosed vulnerability tracking
  • Restrict model tool/function calling to only what is needed — minimize available capabilities

Human-in-the-loop

  • Require explicit user confirmation before executing any sensitive or destructive LLM-triggered action — this is the single most effective mitigation

3. Agent Identity and Permissions

Distinct agent identity

  • Each agent MUST have its own identity (service account, SPIFFE ID) — never inherit or impersonate a human user's identity
  • Assign agent-specific scopes and permissions tailored to its purpose (least privilege)
  • Include agent identity in all audit logs; distinguish agent actions from human actions

Delegation

  • When an agent acts on behalf of a user, use delegation mechanisms (OAuth Token Exchange with act claim) that preserve both identities
  • A compromised agent should only be able to access its own permissions, not the delegating user's full access
json
{
  "action": "tool:execute",
  "actor": {
    "type": "agent",
    "id": "agent:data-analyst-v2",
    "delegated_by": "user:jane.doe"
  }
}

4. Credential Hygiene

No credential forwarding

FORBIDDEN: Never forward user credentials or authentication tokens to downstream tools or third-party APIs.

python
# WRONG — never forward user tokens
headers = {"Authorization": f"Bearer {user_token}"}
requests.post(tool_url, headers=headers, json=params)
python
# CORRECT — use the server's own credentials
server_token = get_server_credential_for(tool_url)
headers = {"Authorization": f"Bearer {server_token}"}
requests.post(tool_url, headers=headers, json=params)

Separate credentials per downstream service

  • MCP servers and agents must obtain their own credentials for downstream services via OAuth client flows, pre-registered service accounts, or Token Exchange
  • Audit all outbound requests to verify user tokens never leak in headers, query parameters, or request bodies
  • Add automated tests verifying user tokens are never forwarded

Granular OAuth scoping

  • Define scopes at the tool and action level (e.g., email.send, files.read, database.query) — never use blanket scopes like tools.all
  • Users must explicitly consent to scopes with clear descriptions
  • Enforce scope checks on every tool invocation as a hard limit regardless of LLM requests

5. Input/Output Filtering

Deploy a guardrails component between the API gateway and inference engine that inspects traffic in both directions:

User/App ↔ API Gateway ↔ Guardrails ↔ Inference Engine ↔ Model

Input direction

ActionWhen to use
BlockKnown injection patterns, adversarial inputs
MaskPII, credentials, sensitive data before model sees it
ModifyRewrite dangerous patterns into safe equivalents
PassClean input that passes all checks

Output direction

ActionWhen to use
BlockHarmful content, policy violations
MaskSensitive training data leakage, internal system details
ModifyRemove problematic portions while preserving useful content
PassClean output that passes all checks

Log all guardrail actions and monitor filter effectiveness. The guardrails component must not be a single point of failure.


6. Sandboxed Execution

When models generate executable code, API calls, or system commands, validate them in an isolated sandbox before execution.

Sandbox requirements

  • Cannot access production data or services
  • Cannot modify the host system
  • No external network access unless explicitly required and scoped
  • Cannot escalate privileges
  • Resource-limited (CPU, memory, time)

Isolation mechanisms

Use one or more: rootless containers with read-only filesystems, MicroVMs (Firecracker, gVisor), seccomp profiles + Linux namespaces, network isolation (NetworkPolicies), or resource limits (cgroups).

Monitor sandbox health and detect escape attempts. Log all executions.


7. MCP Server Security

Authentication

  • Authenticate all agent-to-MCP-server connections using SPIFFE/mTLS (preferred) or OAuth client credentials
  • Fall back to OAuth user delegation only if SPIFFE infrastructure is unavailable

Injection prevention

  • Never use os.system() or shell=True — always use parameterized APIs
python
# CORRECT — parameterized, no shell
subprocess.run(["echo", user_input], shell=False)

# FORBIDDEN — shell injection risk
os.system(f"echo {user_input}")
subprocess.run(f"echo {user_input}", shell=True)

Hardening

  • Run MCP servers under a dedicated unprivileged user account, never as root
  • Drop all unnecessary Linux capabilities
  • Apply the principle of least privilege for filesystem, network, and system access
  • Drop specific privileges before executing each tool command

Update integrity

  • Sign all server binaries and container images digitally
  • Support and document version pinning — enable clients to pin to specific versions and digests
yaml
mcp_server:
  image: registry.example.com/mcp-server:v1.2.3@sha256:abc123...
  • Do not auto-update without user consent or verification
  • Publish changelogs for every release and support rollback to previous trusted versions

Review Checklist

For any AI system architecture review, verify:

  • All LLM API connections use TLS; credentials are in secret management, not source code
  • Input and output guardrails are deployed; prompt injection defense is layered
  • Human-in-the-loop required for destructive or sensitive actions
  • Agents have their own identity and scoped permissions, separate from users
  • User credentials are never forwarded through agents or MCP servers
  • OAuth scopes are granular (per tool/action), not blanket
  • Model-generated code/commands are validated in a sandbox before execution
  • MCP servers use parameterized APIs, run non-root, and are signed/pinned
  • Audit logs distinguish agent actions from human actions
  • Self-hosted models are scanned for malicious code and verified for integrity

Relationship to Other Skills

  • ai-code-review — Reviewing code generated by AI assistants for correctness. This skill covers the systems that run AI.
  • prompt-injection-mitigation — Deep dive on prompt injection techniques and mitigations. This skill summarizes the key points.
  • agent-identity — Full treatment of agent identity management. This skill covers the essentials.
  • container-hardening — General container security. This skill adds AI-specific container concerns (model serving, MCP servers).

よくある質問

AIスキル「Ai Systems Security」では何ができますか?

Secure AI-powered products and infrastructure. Use when integrating LLM APIs, deploying model-serving infrastructure, building agent workflows, connecting MCP servers, or reviewing AI system architecture for security gaps.

TypingMindでAi Systems Securityを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Ai Systems Securityはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにAi Systems Securityをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/RedHatProductSecurity/prodsec-skills/tree/main/ge-core/ai-systems-securityを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Ai Systems Securityを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Ai Systems Securityで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもAi Systems Securityを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Ai Systems Security」は無料ですか?

はい。RedHatProductSecurityがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇