Từ Context Engineering đến thiết kế toàn bộ runtime environment cho Agent — năng lực cạnh tranh thực sự trong kỷ nguyên Agentic Coding.
System prompt, instruction files, conversation history, tool outputs
Built-in tools, MCP servers, custom tools, sub-agent spawn
Permissions, Sandbox, Content Filters, Approval Gates, Validators
PreToolUse, PostToolUse, SessionStart, UserPromptSubmit, Stop
Lazy-loaded capabilities — nạp đúng khi cần
Short-term (in-context) + Long-term (persistent file/DB)
Session logs, traces, telemetry, cost attribution, evals & quality loops
Agent có context tuyệt vời nhưng tool registry kém sẽ fail ngay bước đầu — không có công cụ phù hợp để thực thi action.
Agent có context và tool tốt nhưng thiếu hooks sẽ không thể ngăn các hành động nguy hiểm — production có thể bị ảnh hưởng.
Định nghĩa vai trò, constraints và behaviors mặc định. Nạp ở đầu mỗi conversation.
Agent được dùng tool nào, access resource nào. Áp dụng least-privilege model.
Agent thực thi trong Docker, VMs, file system jails — không leak ra ngoài.
Kiểm tra content vào/ra: lọc PII, jailbreak, hallucination, off-topic.
Yêu cầu confirm trước action quan trọng: deploy production, delete file, payment.
Giới hạn topics, không cho Agent đi ra ngoài scope dự án.
Automated check: linters, type checkers, schema validators, code review, unit tests.
Security checkpoint chính: validate input, ghi audit log, hỏi xác nhận user, chặn hành động nguy hiểm.
Validate output, inject thêm context, trigger side effects (linter, formatter, test runner).
Load memory từ previous session, inject context động, khởi tạo state.
Enrich prompt với context, privacy filtering, log requests.
Lưu session state, generate summary, cleanup resources.
Core set 5 events đã convergence thành de facto standard — chưa có open spec chung.
Đọc file memory từ previous session → inject vào context → agent có context đầy đủ ngay từ đầu.
Intercept mọi tool call → check permission policy → chặn nếu vi phạm → ghi audit log.
Sau mỗi tool call → cập nhật memory với kết quả mới → trigger linter/test runner nếu cần.
Facts, history, instructions — những gì agent biết.
Những gì agent có thể làm — gọi tool, gọi API.
Cách agent xử lý tác vụ — lazy loading, nạp đúng khi cần.
→ Nằm trong context window, tự xóa khi session kết thúc.
→ Agent "nhớ" qua nhiều session — tích lũy domain knowledge.
Toàn bộ messages, tool calls, kết quả. Claude Code transcript, Codex session log.
Mỗi step Agent là 1 span — latency, token, cost. Tools: LangSmith, Langfuse, OpenTelemetry.
Token usage per session, tool call frequency, error rate, success rate.
Cost per task / team / workflow — alerting khi vượt budget.
Benchmark replay sessions, regression test giữa các model versions, dùng 1 model khác để chấm output.
Không chỉ biết mà phải thực hành: viết hooks, design skills, configure permissions, setup observability.
Chuyển các Standard Operating Procedure thành Skills, share giữa members, chuẩn hóa quy trình làm việc.
Logging, tracing, cost attribution để liên tục cải tiến flow Agent dựa trên dữ liệu thực tế.
Harness Engineering là kỹ năng accumulate qua practice. Thử nghiệm → đo lường → cải tiến → lặp lại.
Toàn bộ thứ bao quanh LLM khi vận hành — tools, hooks, permissions, skills, memory, observability, không chỉ context window.
Context Engineering là một component của Harness Engineering. Giỏi context nhưng bỏ qua phần còn lại = tối ưu một phần nhỏ hệ thống.
Context Loading · Tool Registry · Guardrails · Hooks · Skills · Memory · Observability. Đây là một lens học tập — không phải con số "thiêng".
Hooks thiết kế tốt tự động kết nối tất cả components — biến general-purpose agent thành tool tùy chỉnh cho workflow team.
Harness Engineering = kỹ năng phân biệt engineer trung bình với xuất sắc trong kỷ nguyên Agentic Coding. Hands-on ngay từ bây giờ.
Kiểm tra định nghĩa, mối quan hệ và các components của Harness.
Harness định nghĩa · Context vs Harness · Components · Hooks · Guardrails · Skills · Observability
Trả lời đúng ít nhất 5/7 câu để hoàn thành Quiz Module 5.
Từ định nghĩa Harness, phân biệt Context vs Harness Engineering, đến 7 components chi tiết và lộ trình phát triển năng lực — nền tảng để bạn thiết kế runtime Agent hiệu quả.
Harness = runtime environment. Context Engineering ⊂ Harness Engineering.
7 components: Context Loading · Tool Registry · Guardrails · Hooks · Skills · Memory · Observability.