Skip to content

Security: yanacuti1121/Yana-AI

Security

SECURITY.md

Security Policy — Yana AI · Chính sách bảo mật

Tiếng Việt bên dưới / Vietnamese below

Supported Versions

Yana AI ships three independently-versioned artifacts (see VERSIONING.md). Only the latest published version of each is supported — this is a solo-maintained project, so there is no separate long-term-support line.

Artifact Current Supported
Product (GitHub Releases) 1.1.0 ✅ Latest only
PyPI (yana-ai) 0.42.4 ✅ Latest only
crates.io (yana-rt) 1.3.3 ✅ Latest only

npm distribution was discontinued 2026-07-30 (see VERSIONING.md's "Why product has no registry" section) — it is no longer a supported or official install channel.


Reporting a Vulnerability

Do not open a public GitHub Issue for security vulnerabilities.

Report privately via:

  • GitHub Security Advisories (preferred): repo → Security tab → Report a vulnerability
  • Email: phamlongh230@gmail.com — include Yana AI SECURITY in the subject line

We will acknowledge reports within 48 hours and aim to patch critical issues within 7 days.


Scope

Yana AI is a governance and safety framework for AI-assisted development. It is not a production authentication, authorization, or secrets-management system.

We treat the following as security-critical:

Type Example
Hook / gate bypass A pattern that lets an agent skip the push, deploy, or destructive-operation gate
Core integrity bypass Modifying core/rules/, core/hooks/, core/gates/, or core/scripts/ without tripping the core-lock manifest (rule 67)
Secret leakage A path where API keys, tokens, or credentials could be logged or exposed — including the Yana web vault (AES-256-GCM, rule 66)
Command injection A hook or script that can be tricked into running unintended shell commands
Prompt-injection laundering External content that defeats the injection scanners and reaches agent context as instructions
Audit log tampering A way to delete, rewrite, or forge the hash-chained audit logs without detection
Unsafe release packaging A published artifact (zip, PyPI, crates.io) that includes secrets, local state, or unintended files

Out of scope:

  • Vulnerabilities in Cursor, Aider, GitHub Copilot, Gemini, OpenRouter, or other third-party AI tools themselves
  • Issues in third-party tools invoked by agents, such as gitleaks, semgrep, gh, git, Docker, or cloud CLIs
  • Misconfiguration in downstream projects after Yana AI is installed
  • Advisory-only behavior for engines where runtime hooks are not wired (see Runtime enforcement below)

Security Architecture

Gate layers (each backed by rules in core/rules/ and hooks in core/hooks/):

  • L0 — Audit chain: append-only, hash-chained logs; tampering breaks the chain and locks execution
  • L1 — Pre-execution guards: anti-evasion (pipe-to-shell, encoded commands), agent hierarchy/tier limits, resource quotas
  • L2 — Sanitize & middleware: shell quoting/sanitize_arg, env-var integrity (LD_PRELOAD, PATH), the 9-step tool middleware pipeline
  • L3 — Isolation & egress: sandboxed execution, SSRF/metadata-endpoint blocking, API security checklist
  • L4 — Supply chain: dependency vetting, typosquat detection, SLSA/provenance checks
  • L5 — Boundary: workspace path-traversal blocks, protected-file write gate
  • L6 — Cognitive reliability (ADR-006): guards agent reports — completion claims, evidence, scope — behavioral today, gate tooling planned

Core surface integrity is pinned by a SHA-256 manifest. Verify any checkout with:

bash core/scripts/verify-core-lock.sh   # exit 0 = intact

Runtime enforcement

Runtime enforcement is hard-blocking for Claude Code (native .claude/settings.json hooks) and Cursor (a real beforeShellExecution hook, not just prompt context).

For other engines (Codex, Antigravity, Windsurf, Kiro, Aider, Copilot, Gemini, OpenCode, Zed, …) the adapters generated by core/scripts/switch-engine.sh are advisory only (prompt-layer) — an agent on those engines can choose to ignore them. Closing that gap is in progress via Program J's MCP server (docs/programs/PROGRAM-J-SKELETON.md), which gives any MCP-capable client the same hard check_command() enforcement, opt-in per engine.


Responsible Disclosure

We follow coordinated disclosure. We will:

  • Credit reporters in CHANGELOG.md, unless anonymity is requested
  • Avoid public disclosure until a fix or mitigation is available
  • Not take legal action against good-faith security research that follows this policy
  • Prioritize fixes based on severity, exploitability, and impact on release-artifact safety

Release Integrity

Official artifacts are published only through these channels:

Channel Artifact
GitHub Releases yana-ai-latest.zip · yana-ai-v<version>-fixed.zip
GitHub Marketplace github.com/marketplace/yana-ai
PyPI yana-ai
crates.io yana-rt

npm is not an official channel — distribution there was discontinued 2026-07-30. Treat any yana-ai package on npm as unofficial and unverified.

PyPI and crates.io are published automatically from a version tag by .github/workflows/publish.yml (PyPI uses OIDC trusted publishing — no long-lived tokens).

Do not install Yana AI from copied folders, unknown archives, or modified release packs. After installing, run bash core/scripts/verify-core-lock.sh to confirm the core surface matches the pinned manifest.


Tiếng Việt

Phiên bản được hỗ trợ

Yana AI phát hành 3 artifact với version độc lập nhau (xem VERSIONING.md). Chỉ bản mới nhất của mỗi artifact được hỗ trợ — đây là dự án 1 người duy trì, không có dòng long-term-support riêng.

Artifact Hiện tại Hỗ trợ
Product (GitHub Releases) 1.1.0 ✅ Chỉ bản mới nhất
PyPI (yana-ai) 0.42.4 ✅ Chỉ bản mới nhất
crates.io (yana-rt) 1.3.3 ✅ Chỉ bản mới nhất

Phân phối qua npm đã ngừng từ 2026-07-30 (xem mục "Why product has no registry" trong VERSIONING.md) — không còn là kênh cài đặt chính thức.

Báo cáo lỗ hổng bảo mật

Không mở GitHub Issue công khai cho các lỗ hổng bảo mật.

Báo cáo riêng tư qua:

  • GitHub Security Advisories (ưu tiên): repo → tab Security → Report a vulnerability
  • Email: phamlongh230@gmail.com — ghi Yana AI SECURITY trong tiêu đề

Chúng tôi sẽ xác nhận báo cáo trong 48 giờ và nhắm vá các vấn đề nghiêm trọng trong 7 ngày.

Phạm vi

Yana AI là framework quản trị và an toàn cho phát triển có AI hỗ trợ. Đây không phải hệ thống xác thực, phân quyền hay quản lý secret cho production.

Các loại vấn đề được coi là nghiêm trọng về bảo mật:

Loại Ví dụ
Bypass hook / gate Pattern cho phép agent bỏ qua gate push, deploy, hoặc thao tác phá hủy
Bypass toàn vẹn core Sửa core/rules/, core/hooks/, core/gates/, core/scripts/ mà không kích hoạt core-lock manifest (rule 67)
Lộ secret Đường dẫn API key, token, credential có thể bị log hoặc expose — gồm cả vault của Yana web (AES-256-GCM, rule 66)
Command injection Hook/script có thể bị lừa chạy lệnh shell ngoài ý muốn
Rửa prompt-injection Nội dung bên ngoài vượt qua scanner và đi vào context của agent dưới dạng chỉ thị
Giả mạo audit log Cách xóa, viết lại hoặc làm giả audit log hash-chain mà không bị phát hiện
Đóng gói release không an toàn Artifact công bố (zip, PyPI, crates.io) chứa secret, trạng thái local, hoặc file ngoài ý muốn

Ngoài phạm vi:

  • Lỗ hổng trong Cursor, Aider, GitHub Copilot, Gemini, OpenRouter và các AI tool bên thứ ba
  • Vấn đề trong công cụ bên thứ ba mà agent gọi (gitleaks, semgrep, gh, git, Docker, cloud CLI)
  • Cấu hình sai trong các dự án downstream sau khi cài Yana AI
  • Hành vi chỉ-tư-vấn trên engine chưa nối runtime hook (xem Thực thi runtime bên dưới)

Kiến trúc bảo mật

Các tầng gate (mỗi tầng có rule trong core/rules/ và hook trong core/hooks/):

  • L0 — Chuỗi audit: log append-only, hash-chain; giả mạo làm đứt chuỗi và khóa thực thi
  • L1 — Guard tiền thực thi: chống né tránh (pipe-to-shell, lệnh mã hóa), giới hạn tier/cấp bậc agent, quota tài nguyên
  • L2 — Sanitize & middleware: quoting shell/sanitize_arg, toàn vẹn biến môi trường (LD_PRELOAD, PATH), pipeline middleware 9 bước
  • L3 — Cô lập & egress: thực thi trong sandbox, chặn SSRF/metadata endpoint, checklist API security
  • L4 — Chuỗi cung ứng: thẩm định dependency, phát hiện typosquat, kiểm tra SLSA/provenance
  • L5 — Ranh giới: chặn path-traversal khỏi workspace, gate ghi file được bảo vệ
  • L6 — Độ tin cậy nhận thức (ADR-006): giám sát báo cáo của agent — tuyên bố hoàn thành, bằng chứng, phạm vi — hiện là hành vi, tooling gate đang lên kế hoạch

Bề mặt core được ghim bằng manifest SHA-256. Kiểm tra bất kỳ bản checkout nào:

bash core/scripts/verify-core-lock.sh   # exit 0 = nguyên vẹn

Thực thi runtime

Thực thi runtime chặn cứng với Claude Code (hook native trong .claude/settings.json) và Cursor (hook beforeShellExecution thật, không chỉ là prompt context).

Với engine khác (Codex, Antigravity, Windsurf, Kiro, Aider, Copilot, Gemini, OpenCode, Zed, …), adapter do core/scripts/switch-engine.sh sinh ra chỉ mang tính tư vấn (lớp prompt) — agent trên các engine này có thể bỏ qua. Đang đóng dần khoảng cách này qua MCP server của Program J (docs/programs/PROGRAM-J-SKELETON.md), cho phép bất kỳ client hỗ trợ MCP nào cũng có cùng mức chặn cứng check_command(), opt-in theo từng engine.

Tiết lộ có trách nhiệm

Chúng tôi tuân theo quy trình tiết lộ có phối hợp:

  • Ghi nhận người báo cáo trong CHANGELOG.md (trừ khi yêu cầu ẩn danh)
  • Không tiết lộ công khai cho đến khi có bản vá hoặc giải pháp tạm thời
  • Không có hành động pháp lý với nghiên cứu bảo mật thiện chí theo chính sách này
  • Ưu tiên vá dựa trên mức độ nghiêm trọng, khả năng khai thác và tác động đến an toàn artifact phát hành

Toàn vẹn phát hành

Artifact chính thức chỉ được công bố qua các kênh:

Kênh Artifact
GitHub Releases yana-ai-latest.zip · yana-ai-v<version>-fixed.zip
GitHub Marketplace github.com/marketplace/yana-ai
PyPI yana-ai
crates.io yana-rt

npm không phải kênh chính thức — đã ngừng phân phối ở đó từ 2026-07-30. Coi bất kỳ package yana-ai nào trên npm là không chính thức, chưa xác minh.

PyPI và crates.io được phát hành tự động từ version tag bởi .github/workflows/publish.yml (PyPI dùng OIDC trusted publishing — không có token sống lâu).

Không cài Yana AI từ thư mục sao chép, archive không rõ nguồn gốc, hoặc gói đã bị chỉnh sửa. Sau khi cài, chạy bash core/scripts/verify-core-lock.sh để xác nhận bề mặt core khớp manifest đã ghim.

There aren't any published security advisories