AI Guardrails vs AI Governance

Guardrail hỏi AI có làm được không. Governance hỏi ta có nên làm không. Guardrails ask if the AI can. Governance asks if we should.

Đây là hai tầng của cùng một hệ thống kiểm soát, không phải hai lựa chọn. Governance đặt luật từ trước. Guardrail thi hành một phần luật đó trên từng request.

These are two layers of one control system, not two options. Governance sets the rules in advance. Guardrails enforce part of those rules on every request.

Governance layer sets policy (dashed) for five runtime guardrails along the request path (solid, flowing). Governance đặt trước, do con người set in advance, by people A chuẩn mựcstandards B owner C danh mụcinventory người dùng user người dùng user kho dữ liệu storage tools 01 02 05 03 04 model
Nét liền chạy: kiểm soát lúc chạy, bằng codeMoving solid line: runtime control, in code Nét đứt đứng yên: luật đặt từ trướcStill dashed line: rules set in advance Cổng viền đứt: ảnh gốc không cóDashed gate: missing from the original image

Ảnh gốc nói thiếu gìWhat the original image gets wrong

Ý lớn của ảnh đúng. Bốn chỗ dưới đây là nơi người đọc dễ đi sai hướng.

The big idea is right. These four points are where readers go wrong.

Chọn cái nàoWhich one do you need

Bắt đầu từ ô tối: có khi bạn chưa cần gì cả. Sau đó mỗi câu trả lời "có" thêm một kiểm soát.

Start with the dark panel: you may need nothing yet. After that, every "yes" adds a control.

Khi không cần gì cả

When you need none of this

Chỉ người nội bộ dùng, không tool nào được ghi hay gửi, không đụng dữ liệu nhạy cảm, và luôn có người đọc lại đầu ra.

Internal users only, no tool can write or send, no sensitive data, and a person always reads the output.

  • Bộ lọc có sẵn của nhà cung cấp model
  • Một trang quy định: không dán dữ liệu khách, mật khẩu, mã bí mật
  • Gói doanh nghiệp cam kết không huấn luyện trên dữ liệu của bạn
  • Một bảng: hệ thống, owner, dữ liệu, model, ngày review
  • The model provider's built-in filters
  • A one-page rule: no customer data, passwords or secret code
  • An enterprise plan that won't train on your data
  • One table: system, owner, data, model, review date

Hết đủ khi: người ngoài gửi input được, agent có quyền ghi, dữ liệu cá nhân vào prompt, hoặc không ai biết công ty chạy bao nhiêu hệ thống AI.

No longer enough when outsiders can send input, an agent can write, personal data enters prompts, or nobody knows how many AI systems you run.

Người ngoài (khách hàng, công chúng) gửi input được?

Can outsiders (customers, the public) send input?

Prompt, tài liệu hay đầu ra có thể chứa dữ liệu cá nhân, secret?

Can prompts, documents or outputs contain personal data or secrets?

Model đọc tài liệu mà không phải ai cũng được xem?

Does the model read documents not everyone may see?

Agent gọi được API có quyền ghi, gửi, xoá, thanh toán?

Can an agent call APIs that write, send, delete or pay?

Chưa có hệ thống nào chạy thật, nhưng sắp có?

Nothing in production yet, but soon?

Từ 3 hệ thống hoặc 2 đội trở lên, hoặc lĩnh vực bị quản lý?

3+ systems or 2+ teams, or a regulated field?

Tra cứu từng khái niệmConcept reference

Mỗi thẻ có câu đánh đổi ngay dưới phần tóm tắt: đọc nó trước, chi tiết sau.

Each card puts the trade-off right under the summary: read that first, details after.

Guardrails

Chạy trên mỗi request, do code thi hành. Đánh số theo đúng thứ tự request đi qua.

Run on every request, enforced by code. Numbered in the order a request passes through.

01

Kiểm tra input

Input guardrail

Guardrail trước modelbefore the model

Chặn nội dung bị cấm và yêu cầu ngoài phạm vi trước khi chúng tới model.

Blocks prohibited content and out-of-scope requests before they reach the model.

Đổi độ trễ và một phần người dùng bị chặn nhầm, lấy việc loại sớm và rẻ các lạm dụng hiển nhiên.

Trades latency and some falsely blocked users for cheap, early rejection of obvious abuse.

Dùng cho
Use for
Chatbot công khai, app cho trẻ em, bot chỉ trả lời về sản phẩm.
Public chatbots, kids' apps, product-only bots.
Được
Gain
Rẻ, chạy trước lượt gọi model chính. Log chặn cho thấy người ta thử phá kiểu gì.
Cheap, runs before the main call. Block logs show how people try to break it.
Mất
Lose
Mù trước injection gián tiếp nằm trong tài liệu, email, trang web.
Blind to indirect injection hidden in documents, emails, web pages.

Dấu hiệu:Signal: bất kỳ ai trên internet cũng gõ được vào ô chat.anyone on the internet can type into the box.

02

Phát hiện PII và secret

PII & secret detection

Guardrail cả hai chiều, trước khi ghi logboth directions, before logging

Tìm và che dữ liệu cá nhân, API key, mật khẩu trong prompt, tài liệu truy xuất, đầu ra và log.

Finds and masks personal data, API keys and passwords in prompts, retrieved docs, outputs and logs.

Đổi một phần độ chính xác của tác vụ lấy việc dữ liệu nhạy cảm không rời khỏi hệ thống.

Trades some task accuracy for sensitive data never leaving your systems.

Dùng cho
Use for
Gửi ticket sang API bên ngoài, trợ lý lập trình, log hội thoại.
Tickets sent to external APIs, coding assistants, chat logs.
Được
Gain
Regex dưới 1 ms, deterministic, dễ test. Pseudonym giữ được ngữ nghĩa.
Regex under 1 ms, deterministic, testable. Pseudonyms keep meaning.
Mất
Lose
Sót PII theo ngữ cảnh. NER tiếng Việt yếu. Che quá tay làm hỏng tác vụ.
Misses contextual PII. Weak NER outside English. Over-masking breaks tasks.

Dấu hiệu:Signal: dữ liệu rời hạ tầng của bạn, hoặc nằm lâu trong log.data leaves your infrastructure, or sits in logs for a long time.

03

Giới hạn phạm vi dữ liệu

Data access scoping

Guardrail tại retrieverat the retriever

Model chỉ truy xuất được tài liệu mà chính người đang hỏi có quyền xem.

The model only retrieves documents the person asking is allowed to read.

Đổi công đồng bộ quyền và một phần recall lấy bảo đảm dữ liệu không tới tay sai người.

Trades ACL sync effort and some recall for a guarantee data never reaches the wrong person.

Dùng cho
Use for
RAG trên wiki nội bộ, SaaS nhiều tenant, trợ lý nhân sự.
Internal wiki RAG, multi-tenant SaaS, HR assistants.
Được
Gain
Deterministic. Injection có thành công thì model cũng không nói được thứ nó chưa thấy.
Deterministic. Even if injection succeeds, the model can't reveal what it never saw.
Mất
Lose
Quyền ở nguồn đổi mà index chưa cập nhật là lộ. Filter làm giảm recall.
Leaks if source permissions change before the index does. Filtering lowers recall.

Dấu hiệu:Signal: có tài liệu mà không phải ai cũng được xem.some documents aren't visible to everyone.

04

Giới hạn tool và hành động

Tool & action restriction

Guardrail tại mỗi lệnh gọi toolat every tool call

Code quyết định agent được gọi API nào, với tham số nào, thay mặt ai. Không phải system prompt.

Code decides which APIs an agent may call, with what parameters, for whom. Not the system prompt.

Đổi mức tự chủ và tốc độ của agent lấy việc chốt được thiệt hại tệ nhất.

Trades agent autonomy and speed for a cap on the worst possible damage.

Dùng cho
Use for
Agent tạo ticket Jira, gửi Slack hay email, đặt lịch.
Agents that file Jira tickets, send Slack or email, book meetings.
Được
Gain
Tuyến phòng thủ chính trước prompt injection. Audit được từng lệnh gọi.
The main defense against prompt injection. Every call is auditable.
Mất
Lose
Chặt quá thì agent vô dụng. Người duyệt mệt sẽ bấm đồng ý theo phản xạ.
Too strict and the agent is useless. Tired approvers click yes by reflex.

Dấu hiệu:Signal: hành động không thu hồi được: gửi, xoá, thanh toán.the action can't be undone: send, delete, pay.

05

Kiểm tra output

Output guardrail

Guardrail sau model, ảnh gốc không cóafter the model, not in the image

Kiểm đầu ra trước khi tới người dùng hay hệ thống khác: schema, PII, nội dung, link lạ.

Checks output before it reaches users or other systems: schema, PII, content, unknown links.

Đổi streaming mượt và độ trễ lấy lưới an toàn cuối trước khi người dùng thấy kết quả.

Trades smooth streaming and latency for a last safety net before the user sees anything.

Dùng cho
Use for
Đầu ra render HTML/Markdown, đi vào SQL hay shell, trả lời về giá và chính sách.
Output rendered as HTML/Markdown, fed into SQL or shell, answers about price and policy.
Được
Gain
Bắt thứ lọt qua 01. Chặn rò dữ liệu qua URL ảnh Markdown.
Catches what slipped past 01. Blocks exfiltration via Markdown image URLs.
Mất
Lose
Phá streaming. Không hoàn tác được hành động agent đã làm.
Breaks streaming. Can't undo actions the agent already took.

Dấu hiệu:Signal: hệ thống phía sau tin đầu ra của model, hoặc câu trả lời có thể bị coi là cam kết.downstream systems trust the output, or an answer could count as a commitment.

Governance

Diễn ra trước khi triển khai và định kỳ sau đó, do con người thi hành. Không có thứ tự, nên dùng chữ cái.

Happens before deployment and periodically after, enforced by people. No inherent order, so letters.

A

Chuẩn mực và chính sách

Standards & policy

Governance toàn tổ chứcorganization-wide

Luật chung: use case nào được làm, dữ liệu nào được đưa vào, model nào được duyệt, mỗi mức rủi ro cần gì.

Shared rules: which use cases are allowed, what data may go in, which models are approved, what each risk tier needs.

Đổi quyền tự quyết của từng đội lấy sự nhất quán và khả năng giải trình với bên ngoài.

Trades each team's autonomy for consistency and accountability to outsiders.

Dùng cho
Use for
Nhiều đội cùng làm AI, lĩnh vực bị quản lý, bán cho doanh nghiệp lớn, có người dùng ở EU.
Many teams building AI, regulated fields, enterprise sales, EU users.
Được
Gain
Đội mới không làm lại từ đầu. Rủi ro thấp đi đường nhanh.
New teams don't start from zero. Low risk gets a fast lane.
Mất
Lose
Không thi hành bằng code thì chỉ là giấy. Duyệt nặng đẩy các đội sang shadow AI.
Unenforced in code, it's paper. Heavy review pushes teams to shadow AI.

Dấu hiệu:Signal: mỗi đội chọn model và cách lọc một kiểu.every team picks models and filters differently.

B

Owner và trách nhiệm

Ownership & accountability

Governance từng hệ thốngper system

Mỗi hệ thống AI có một người chịu trách nhiệm có tên, và một nút tắt đã được diễn tập.

Every AI system has one named person responsible, and a kill switch that has been rehearsed.

Đổi thời gian của một người cụ thể lấy tốc độ phản ứng khi có sự cố.

Trades one specific person's time for faster incident response.

Dùng cho
Use for
Chatbot trả lời khách, quyết định tự động về con người, agent chạy theo lịch.
Customer chatbots, automated decisions about people, scheduled agents.
Được
Gain
Sự cố có người nhận ngay. Đổi prompt hay model có người duyệt.
Incidents get picked up at once. Prompt and model changes get reviewed.
Mất
Lose
Owner không có quyền hay thời gian thì vô nghĩa. Nghỉ việc mà không bàn giao là mất.
Meaningless without authority or time. Lost if they leave without handover.

Dấu hiệu:Signal: không ai nhớ system prompt do ai viết.nobody remembers who wrote the system prompt.

C

Danh mục hệ thống AI

AI system inventory

Governance cả danh mụcwhole portfolio

Danh mục sống của mọi hệ thống AI: model, dữ liệu, tool, owner, mức rủi ro, ngày review.

A living catalog of every AI system: model, data, tools, owner, risk tier, review date.

Đổi một bước đăng ký bắt buộc khi deploy lấy khả năng nhìn thấy toàn bộ bề mặt rủi ro.

Trades a mandatory registration step at deploy for visibility into the whole risk surface.

Dùng cho
Use for
Nhiều API key trên hoá đơn, nhà cung cấp ngừng một phiên bản model, quy định mới ra.
Many API keys on the bill, a model version being retired, new regulation.
Được
Gain
Biết đang chạy bao nhiêu hệ thống AI. Đổi model là có ngay danh sách tác động.
You know how many AI systems you run. Model swaps come with an impact list.
Mất
Lose
Nhập tay thì lỗi thời sau vài tuần. Không thấy công cụ dùng qua tài khoản cá nhân.
Stale within weeks if manual. Blind to tools used on personal accounts.

Dấu hiệu:Signal: hoá đơn có API key không rõ của ai.the bill has API keys nobody can attribute.

Bảng đánh đổiTrade-off table

Các trục là những câu bạn thật sự phải trả lời khi chọn.

The axes are the questions you actually have to answer when choosing.

Ai thi hànhEnforced by Khi nàoWhen Tính chấtNature Trước prompt injectionAgainst prompt injection Công vận hànhOps effort Khi hỏngFailure mode
01 InputInputCodeMỗi requestEvery requestLuật cứng + xác suấtHard rules + probabilisticYếuWeakTrung bìnhMediumChặn nhầm hoặc để lọtFalse blocks or misses
02 PIICodeMỗi request, mỗi lần ghi logEvery request and log writeDeterministic + NERKhông liên quanNot relevantThấpLowLộ dữ liệu âm thầmSilent data leak
03 Dữ liệuDataCodeMỗi truy vấnEvery queryDeterministicMạnhStrongCao: đồng bộ ACLHigh: ACL syncLộ chéo người dùngCross-user leak
04 ToolCode + người duyệtCode + approverMỗi lệnh gọi toolEvery tool callDeterministicMạnh nhấtStrongestTrung bìnhMediumHành động không đảo ngượcIrreversible action
05 OutputCodeMỗi responseEvery responseSchema + xác suấtSchema + probabilisticTrung bìnhMediumTrung bìnhMediumCâu trả lời sai tới người dùngWrong answer reaches user
A Chuẩn mựcStandardsCon ngườiPeopleTrước triển khai, mỗi quýPre-deploy, quarterlyTổ chứcOrganizationalGián tiếpIndirectTrung bìnhMediumMỗi đội một kiểuEvery team differs
B OwnerCon ngườiPeopleLiên tụcContinuousTổ chứcOrganizationalKhôngNoneThấpLowSự cố không ai xử lýNobody handles incidents
C Danh mụcInventoryNgười + tự độngPeople + automationMỗi lần deployEvery deployTổ chứcOrganizationalKhôngNoneThấp đến trung bìnhLow to mediumKhông biết mình chạy gìUnknown what you run

Đọc nhanh: 02, 03, 04 là deterministic, nơi đặt những gì bắt buộc phải đúng. 01 và 05 là lưới phụ. Governance không chặn gì lúc chạy, nhưng quyết định lớp nào phải có.

Quick read: 02, 03, 04 are deterministic, where anything that must be right goes. 01 and 05 are secondary nets. Governance blocks nothing at runtime, but decides which layers must exist.

Anti-patterns

Sai lầm, vì sao sai, và cách sửa.

The mistake, why it's wrong, and the fix.

3 câu cần nhớ3 things to remember

  1. Governance quyết định luật, guardrail thi hành một phần luật đó lúc chạy.Governance decides the rules; guardrails enforce part of them at runtime.
  2. Thứ gì bắt buộc phải đúng thì thi hành bằng code deterministic, không nhờ model.Anything that must be right is enforced in deterministic code, not by the model.
  3. Giả định injection sẽ thành công, và thiết kế sao cho thiệt hại vẫn nhỏ.Assume injection will succeed, and design so the damage stays small.