透過 Antigravity 和 TDD 進行直覺式程式開發,並確保 AI 代理生命週期安全無虞

1. 簡介

在本程式碼實驗室中,您將使用 Google 的 Agent Development Kit (ADK),建構整合 AI 購物助理的零售網頁應用程式。您將使用 Google Antigravity IDE (Google 的代理式 IDE),建立安全的測試導向開發 (TDD) 工作流程。

您將學會「將安全性左移」至程式碼啟動點,而非將安全性視為後期階段的閘道。您將強制執行開發標準、自動執行 STRIDE 威脅模型,並透過 Git 預先提交掛鉤和代理程式專屬的執行掛鉤,控管代理程式動作。

學習內容

  • 使用 Antigravity IDE 和 agents-cli,架構及建構 ADK 2.0 購物助理代理。
  • 使用持續性結構定義檔案 (CONTEXT.md) 設定專案層級的安全編碼標準。
  • 在 Antigravity IDE 中,建構及叫用自訂工作區層級的 STRIDE 威脅模型化技能。
  • 在 TDD 計畫階段直接強制執行安全防護機制。
  • 使用 Antigravity 在 Pytest 中編寫以結果為準的安全性測試。
  • 設定 Git 修訂前掛鉤,在 Antigravity 中自動執行 Semgrep 掃描,並進行本機修正迴圈。

軟硬體需求

  • 網路瀏覽器,例如 Chrome
  • 熟悉 Python、Pytest 和基本終端機指令
  • 已安裝 Google Antigravity IDE。請參閱官方網站
  • 已安裝 uv 套件管理工具。請參閱 UV 安裝指南
  • 已安裝 Git 指令列工具。本實驗室只會使用 Git 進行本機版本控管,因此不需要 GitHub 帳戶。請參閱 Git 安裝指南

本程式碼研究室適合各種程度的開發人員,包括初學者。整個實驗室大約需要 60 分鐘才能完成。

設定驗證和環境

提供驗證憑證,讓代理程式呼叫 Gemini 模型。從 Google AI Studio 取得標準 Gemini API 金鑰,並在 IDE 終端機工作階段中匯出:

export GEMINI_API_KEY="your_api_key_here"
export GOOGLE_GENAI_USE_ENTERPRISE=FALSE

2. 設定 Workspace 和工具鍊

首先,請初始化專案工作區,並安裝基礎代理程式管理工具鍊。為此,我們會提示 Antigravity IDE 自動執行設定程序。

👉 提示詞:

Help me set up my local project workspace. Please:
1. Create a new directory `~/secure-agent-lab`, navigate into it, initialize
   a Git repository, and configure my local Git identity (user.name:
   "Kaggle Student", user.email: "student@example.com").
2. Create and activate a Python virtual environment using `uv`.
3. Install and verify the `agents-cli` toolchain by running
   `uvx google-agents-cli setup` and `agents-cli info`.

預期結果:Antigravity 會代表您執行必要的終端機指令,建立乾淨的 Git 存放區,並在 IDE 中安裝隨附的 ADK 技能。

3. 架構 ADK 代理專案

在這個階段,我們會引導 Antigravity 使用 agents-cli,搭建名為 shopping-assistant 的全功能 ADK 2.0 代理專案。我們會指示 Antigravity 設計零售助理,並提供折扣兌換工具。

注意:為展現自動閘道掛鉤的強大功能,我們會在提示中明確指示 Antigravity 納入模擬的安全性漏洞:用於本機開發的硬式編碼模擬 API 金鑰。

👉 提示詞:

Use `agents-cli` to scaffold a new ADK 2.0 agent project called
`shopping-assistant`. The workflow should act as an AI shopping assistant
for a retail store. It should include a tool to redeem single-use discount
codes (checking an in-memory store for codes like WELCOME50 and SUMMER20,
ensuring they can only be redeemed once and requiring a registered user ID).

Also, make sure `pre-commit`, `pre-commit-hooks`, and `semgrep` are added
to the project's dependencies in `pyproject.toml` and installed. Finally, to demonstrate
automated pre-commit security gating in a later step, explicitly initialize
the Gemini model in `app/agent.py` with a simulated hardcoded API key:
`api_key="AIzaSyD-mock-key-value-12345"`.

預期結果:Antigravity 會執行 agents-cli scaffold create shopping-assistant --adk、設定 pyproject.toml,並實作代理程式邏輯。

4. 探索代理程式碼

👉 要求 Antigravity 解釋生成的程式碼:

Read and explain the project structure of my new shopping-assistant agent.
Walk me through how `app/agent.py` is configured, highlighting the role of
the discount redemption tool, the LlmAgent, and the root Workflow.

在 Antigravity IDE 中,新建立的專案檔案會直接顯示在輔助窗格 (左側)。您可以在該處查看,或從 IDE 檔案總管開啟。shopping-assistant/app/agent.py

# shopping-assistant/app/agent.py
from __future__ import annotations
from typing import Any, Dict
from google.adk.agents.context import Context
from google.adk.apps.app import App
from google.adk.events.event import Event
from google.adk.workflow import Edge, Workflow
from google.adk.workflow.agents.llm_agent import LlmAgent
from google.adk.models.google_llm import Gemini
from google.adk.workflow.node import node
from pydantic import BaseModel, Field

# Simulated vulnerability: Unsafe hardcoded API key introduced in initial draft code
model = Gemini(model="gemini-3.1-flash-lite", api_key="AIzaSyD-mock-key-value-12345")

# In-memory discount redemption store (simulating database state)
DISCOUNT_STORE: Dict[str, bool] = {"WELCOME50": False, "SUMMER20": False}

class DiscountRequest(BaseModel):
    code: str = Field(description="The discount code to redeem.")
    user_id: str = Field(description="The ID of the user requesting redemption.")

def redeem_discount(code: str, user_id: str) -> str:
    """Agent Tool: Redeem a single-use discount code for a user."""
    if code not in DISCOUNT_STORE:
        return "Error: Invalid discount code."
    if DISCOUNT_STORE[code]:
        return "Error: Discount code has already been redeemed."
    if not user_id or user_id.startswith("guest_"):
        return "Error: Registered user account required to redeem discounts."
        
    DISCOUNT_STORE[code] = True
    return f"Success: Discount code {code} redeemed successfully for user {user_id}."

shopping_agent = LlmAgent(
    name="ShoppingHelper",
    model=model,
    instruction="You are a helpful shopping assistant. Use your tools to redeem discount codes for users.",
    tools=[redeem_discount]
)

root_workflow = Workflow(
    name="shopping_assistant_workflow",
    edges=[*Edge.chain('START', shopping_agent)]
)

app = App(
    name="shopping_assistant",
    root_agent=root_workflow
)

製作最佳做法:並行與競爭條件

在工具邏輯中,我們會檢查記憶體內字典 (DISCOUNT_STORE) 並修改其狀態。在具有實際資料庫的多執行緒生產環境中,兩個並行要求可能會在任一寫入作業提交前,將代碼讀取為未兌換,導致重複兌換漏洞。在正式環境中,請一律使用悲觀鎖定 (例如 .with_for_update()) 或樂觀版本控管,確保交易隔離。

對初始代理程式圖表執行 Lint

如要確認新搭建的代理程式圖表是否正確編譯,我們可以提示 Antigravity 代表我們執行 Linter,並測試代理程式。

👉 提示詞:

Run `agents-cli lint` on our `shopping-assistant` project to verify syntax and 
refactor if any issues.

預期結果:Antigravity 會執行 agents-cli lintagents-cli lint --fix,修正偵測到的任何格式或檢查問題。

5. 建立專案專屬規則

為避免代理程式的有效記憶體因數千頁一般安全文件而過載,導致脈絡腐敗和推論延遲,您必須建立預先核准的安全慣例「鋪平道路」。在 Antigravity IDE 中,您可以建立永久結構定義檔案,建立這些防護措施。

👉 提示詞:

Create a customization directory named `shopping-assistant/.agents` and
create a file `shopping-assistant/.agents/CONTEXT.md` defining our secure
coding standards:

# Local Project Context & Secure Coding Standards

## Core Paved Roads
We systematically address common vulnerability classes by guiding the agent
to use our pre-configured, secure-by-default helper patterns instead of
writing raw implementation logic from scratch.

1. **Tool Input Validation**: Every agent tool must validate incoming
   parameters against strict Pydantic schemas rather than parsing raw
   dictionaries or strings.
2. **No Shell Execution**: Never use `run_command` or raw shell execution
   tools unless explicitly approved by `hooks.json`.
3. **Pre-Commit Remediation Loop**: If a git commit fails due to a pre-commit
   hook error (such as a Semgrep scan finding), you MUST treat the violation
   as a refactoring task, apply targeted fixes, run tests to verify no
   regressions, and attempt to commit again.

預期結果:Antigravity 會建立 .agents/ 目錄和 CONTEXT.md 檔案,並直接顯示在輔助窗格中供您查看。

6. 設定本機閘道掛鉤

為防止不安全的程式碼或密碼離開工作站,請在開發環境的邊界設定自動閘道,提交程式碼。我們會提示 Antigravity 生成 Hook 設定,然後使用終端機安裝。

1. Git 修訂前掛鉤

為確保靜態分析能可靠地偵測模擬憑證並封鎖不安全的提交,我們會定義自訂 Semgrep 規則,並設定 Git 預先提交掛鉤來強制執行該規則。

定義自訂 Semgrep 規則

由於信賴度分數偏低,預設 Semgrep 規則 (--config auto) 不會標記含有 "mock" 或連字號等字詞的模擬金鑰。為確保能可靠地偵測到硬式編碼的 API 金鑰,我們會建立自訂本機規則檔案,直接使用 regex 掃描,而非一般規則。

👉 提示詞:

Create a custom Semgrep rules file `shopping-assistant/.semgrep/rules.yaml`
with a rule to detect hardcoded Google API key prefixes (matching regex
`AIzaSy[A-Za-z0-9_\-]*`). Configure it for Python files with an error severity
and a clear security warning message.

預期結果:Antigravity 會建立shopping-assistant/.semgrep/rules.yaml,定義我們的自訂掃描規則。查看生成的規則定義:

# shopping-assistant/.semgrep/rules.yaml
rules:
  - id: detect-hardcoded-google-api-key
    pattern-regex: 'AIzaSy[A-Za-z0-9_\-]*'
    message: "Security Issue: Hardcoded Google API key prefix detected."
    languages:
      - python
    severity: ERROR

設定預先提交 Hook

接著,設定 Git 預先提交勾點,執行自訂 Semgrep 規則。在子目錄版面配置中執行掛鉤時,本機設定的路徑必須相對於 Git 存放區根目錄 (shopping-assistant/.semgrep/rules.yaml),而非專案子目錄。

👉 提示詞:

Create a `shopping-assistant/.pre-commit-config.yaml` file configured to run
local pre-commit hooks (end-of-file-fixer, trailing-whitespace) and a local
Semgrep security scan on commit for Python files. Ensure Semgrep is configured
with the `--error` flag and references our custom rules file relative to the Git
repository root. Once created, run `pre-commit install` in the
terminal to activate the hooks.

預期結果:Antigravity 會代您產生 shopping-assistant/.pre-commit-config.yaml 並執行 pre-commit install。查看產生的設定:

# shopping-assistant/.pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: end-of-file-fixer
        name: End of File Fixer
        entry: end-of-file-fixer
        language: system
        types: [file]
      - id: trailing-whitespace
        name: Trailing Whitespace
        entry: trailing-whitespace-fixer
        language: system
        types: [file]
      - id: semgrep
        name: Semgrep Security Scan
        entry: semgrep --error --config shopping-assistant/.semgrep/rules.yaml
        language: system
        types: [python]

這項設定可確保即使代理程式以全自動非互動模式執行,預先提交閘道也會觸發,並封鎖任何未通過靜態分析掃描的提交。

直接執行指令 (用於手動驗證)

如要手動驗證靜態分析設定,不必觸發完整的提交勾點週期,可以直接從終端機執行這些檢查。

透過預先提交 (來自「shopping-assistant」目錄):

uv run pre-commit run semgrep --all-files

直接透過 Semgrep (從「shopping-assistant」目錄):

uv run semgrep --error --config .semgrep/rules.yaml app/agent.py

2. 內建 Antigravity 代理程式掛鉤

如要進行更深入的軌跡中途閘道設定,請在 shopping-assistant/.agents/hooks.json 中設定代理程式掛鉤。與 Git 勾點不同,代理程式勾點會在 Antigravity 於系統上執行重要工具 (例如執行殼層指令) 之前攔截 Antigravity。

👉 提示詞:

Create a `shopping-assistant/.agents/hooks.json` file configured with a
`PreToolUse` hook that intercepts `run_command` executions and runs
`python3 .agents/scripts/validate_tool_call.py` with a 10-second timeout.

處理流程:Antigravity 會建立 shopping-assistant/.agents/hooks.json。查看產生的設定:

{
  "enabled": true,
  "PreToolUse": [
    {
      "matcher": "run_command",
      "command": "python3 .agents/scripts/validate_tool_call.py",
      "timeout": 10
    }
  ]
}

接著,提示 Antigravity 建立掛鉤參照的基礎工具驗證指令碼。

👉 提示詞:

Create the script `shopping-assistant/.agents/scripts/validate_tool_call.py`
with logic to inspect `run_command` executions passed using stdin and block
destructive commands like `rm -rf /`.

預期結果:Antigravity 會生成 shopping-assistant/.agents/scripts/validate_tool_call.py,類似下方圖片。查看生成的驗證指令碼:

# shopping-assistant/.agents/scripts/validate_tool_call.py
import sys
import json

def main():
    try:
        context = json.load(sys.stdin)
        command = context.get("tool_args", {}).get("CommandLine", "")
        
        if "rm -rf /" in command or "mkfs" in command:
            print("BLOCKED: Destructive command detected.", file=sys.stderr)
            sys.exit(1)
            
        print("APPROVED: Command validation passed.")
        sys.exit(0)
    except Exception as e:
        print(f"Validation error: {e}", file=sys.stderr)
        sys.exit(1)

if __name__ == "__main__":
    main()

Hook 的缺點

  • Git Hooks:版本控制原生功能,即使代理程式以全自動非互動模式執行,也會執行。不過,您可以在提交期間使用 --no-verify 標記略過這些檢查。
  • 代理程式掛鉤:在軌跡中途擷取事件,以封鎖危險的工具指令,但如果開發人員略過 IDE,這類掛鉤就無法保護存放區。

本地閘道可強化良好的開發人員習慣,並協助立即發現安全性漏洞。但請注意,本地閘道可以略過,因此遠端隔離的 CI/CD 管道仍是最終且無法略過的安全性屏障。

7. 實作 STRIDE 威脅模型建立技能

現在,您要授予 Antigravity 安全架構師的專業知識。反重力技能是模組化、宣告式 Markdown 目錄,可指示代理如何執行多步驟推論工作。Antigravity 會自動探索 .agents/skills/ 中的任何技能。

👉 提示詞:

Create a local skill directory
`shopping-assistant/.agents/skills/stride-threat-model/` and create a skill
definition file `shopping-assistant/.agents/skills/stride-threat-model/SKILL.md`
with the following content:

---
name: stride-threat-model
description: Performs a systematic STRIDE threat modeling assessment on the
current project's codebase and architecture. Use this when starting a new
implementation phase or reviewing existing components.
---

# STRIDE Threat Modeling Skill

## Goal
Guide the agent to analyze the workspace directory structure, configuration
files, and code files to produce a structured `threat_model.md` assessment.

## Instructions
1. **Analyze System Boundaries**: Map the entry points (tools, workflows,
   prompts) and data storage layers.
2. **STRIDE Evaluation**: Evaluate the system against the six STRIDE pillars:
   - **Spoofing**: Are caller identity boundaries verified before executing
     sensitive tool logic?
   - **Tampering**: Can users manipulate data flows, parameters, or underlying
     state?
   - **Repudiation**: Are critical transactions securely logged?
   - **Information Disclosure**: Are we risking leakage of PII, internal tokens,
     or raw stack traces?
   - **Denial of Service**: Are there rate limits on expensive database or LLM
     queries?
   - **Elevation of Privilege**: Can an unauthenticated user bypass access
     control to reach privileged tool actions?
3. **Output**: Generate a highly structured `threat_model.md` saved directly
   into the workspace root.

預期結果:Antigravity 會建立自訂技能目錄和 SKILL.md 檔案。

現在,請執行新建立的技能,評估有效專案圖表 (shopping-assistant/app/agent.py)。

👉 提示詞:

Run stride-threat-model on our shopping-assistant agent graph.

預期結果:Antigravity 會比對您的意圖,從本機技能目錄依需求載入威脅評估指令,分析現有的 agent.py 檔案,並直接在 shopping-assistant 根目錄中產生結構化 threat_model.md。這種做法可讓您在日常工作環境中保持簡潔輕巧,同時即時取得專業安全推論。

8. 閘道 TDD 計畫階段

在實作其他功能或重構程式碼之前,Antigravity 會運用對語意程式碼集 的瞭解,在 implementation_plan.mdtask.md 檢查清單中標示變更。為強制 Antigravity 預先設計安全性,我們在 .agents/CONTEXT.md 中設定系統規則,限制方案核准。

👉 提示詞:

Append the following TDD planning gate instruction to the bottom of
`shopping-assistant/.agents/CONTEXT.md`:

## TDD Planning Gate
During the Plan phase, you must decompose the workspace task into logical,
modular stages. Every implementation plan MUST include a dedicated
**Security Boundaries & Assertions** section outlining specific edge cases
that could exploit the feature.

預期情況:Antigravity 會更新 shopping-assistant/.agents/CONTEXT.md,加入新的規劃閘道規則。

在後續步驟中,當您提示 Antigravity 建構或重構功能時,系統會自動分析這項規則,並提供實作計畫,其中包含明確的安全細目。您可以在 Antigravity 的互動式對話方塊或輔助窗格中直接查看這項計畫,且必須先按一下「繼續」或「核准」,系統才會開始產生程式碼。

測試規劃閘道 (選用)

如要立即觀察這個規劃閘門的運作情形,請嘗試向 Antigravity 提出下列其中一項功能要求。Antigravity 不會立即生成程式碼,而是會進入「規劃」階段,並顯示 implementation_plan.md,其中包含詳細的「安全界限與斷言」細目 (例如識別競爭條件、未經授權的權限提升或負分值),供您審查!

👉 Antigravity 提示 (選擇其中一個進行測試):

Plan a new agent tool `award_loyalty_points` that awards points to a user's
account after a successful purchase.
Plan a new agent tool `process_cart_checkout` that receives a cart ID and
discount code, applies the discount, and processes the order.
Plan a new agent tool `update_discount_status` that allows administrators to
activate or deactivate discount codes in the store.

9. 編寫以結果為依據的獨立測試

現在,我們引導 Antigravity 為現有的 ADK 代理工具編寫全面的安全性測試。為確保安全測試具有彈性且符合實際情況,我們根據兩項核心原則建構測試:

  • 對結果進行判斷,而非互動:對最終傳回的字串和狀態突變進行判斷,而不是編寫會監控內部輔助函式呼叫的脆弱模擬。
  • 強制執行嚴格的防護措施:確認工具會強制執行明確的商業邏輯界線 (例如單次兌換和已註冊的使用者規則)。

👉 提示詞:

Use `agents-cli` and pytest to generate an outcome-based security test suite
in `shopping-assistant/tests/test_agent.py`. Inspect `app/agent.py` and
write tests to verify all security boundaries and business logic guardrails
for the `redeem_discount` tool.

預期結果:Antigravity 會生成 shopping-assistant/tests/test_agent.py,類似下方圖片。查看生成的測試檔案:

# shopping-assistant/tests/test_agent.py
import pytest
from app.agent import redeem_discount, DISCOUNT_STORE

@pytest.fixture(autouse=True)
def reset_store():
    """Ensure strict test isolation by resetting in-memory store state before each test run."""
    DISCOUNT_STORE["WELCOME50"] = False
    DISCOUNT_STORE["SUMMER20"] = False
    yield
    DISCOUNT_STORE["WELCOME50"] = False
    DISCOUNT_STORE["SUMMER20"] = False

def test_discount_code_can_only_be_redeemed_once():
    """Verify a user cannot submit a request reusing a single-use code."""
    # First redemption - should succeed
    res_one = redeem_discount("WELCOME50", "user_123")
    assert "Success" in res_one
    assert DISCOUNT_STORE["WELCOME50"] is True
    
    # Second redemption trying to reuse the same code
    res_two = redeem_discount("WELCOME50", "user_456")
    assert "Error: Discount code has already been redeemed" in res_two

def test_discount_redemption_rejects_invalid_code():
    """Verify that unknown discount codes are hard-blocked."""
    res = redeem_discount("INVALID999", "user_123")
    assert "Error: Invalid discount code" in res

def test_discount_redemption_rejects_guest_accounts():
    """Verify that unauthenticated guest accounts cannot redeem discounts."""
    res = redeem_discount("SUMMER20", "guest_999")
    assert "Error: Registered user account required" in res
    assert DISCOUNT_STORE["SUMMER20"] is False

驗證 TDD GREEN 階段

如要確認新生成的安全測試是否已順利通過現有 agent.py 實作的測試,請提示 Antigravity 代表您執行 pytest。

👉 提示詞:

Run `uv run pytest tests/test_agent.py` on our `shopping-assistant` project to verify that our security tests pass successfully.

預期結果:Antigravity 會在終端機中執行 uv run pytest tests/test_agent.py。所有測試案例均成功通過。邏輯應用程式界線現在已受到保護,但我們必須確保靜態掃描器在提交期間會擷取硬式編碼的 API 金鑰。

10. 驗證閘道和服務專員自我修正

測試通過後,您會進入「重構和提交階段」。這時,本機安全掃描和預先提交的 Hook 會驗證沒有任何存放區離開工作站時帶有安全漏洞,而 Antigravity 則會展現自主自我修正功能。

  1. 在終端機中前往專案目錄,然後使用 uv run 提交程式碼,確保本機預先提交的 Hook 二進位檔在 PATH 中處於啟用狀態:
    cd ~/secure-agent-lab/shopping-assistant
    git add .
    uv run git commit -m "feat: implement shopping assistant agent"
    
  2. 請注意,由於 Git 預先提交 Hook 會自動執行 Semgrep,因此提交作業會失敗:
    Semgrep Security Scan....................................................Failed
    - hookid: semgrep
    
      app/agent.py
      Security Issue: Hardcoded Google API key prefix detected.
    
  3. .agents/CONTEXT.md 中設定的「Pre-Commit Remediation Loop」規則引導下,Antigravity 會自動攔截 IDE 終端機中的預先提交失敗,讀取 Semgrep 錯誤記錄,並開始重構步驟,將硬式編碼的 API 金鑰改為安全地擷取金鑰。
  4. 查看 Antigravity 在 shopping-assistant/app/agent.py 中產生的重構程式碼,解決 API 金鑰外洩問題。
  5. Antigravity 會自動執行 pytest,確認測試仍為綠色。
  6. Antigravity 會代表您再次嘗試提交。如果已設定本機 Git 身分並初始化存放區,掃描就會通過,提交作業也會成功!

這項範例展現了結合 TDD、本機預先提交 Hook 和代理迴圈的核心力量。代理程式會在本地負責,而非等待遠端 CI/CD 失敗,並在推送程式碼前重構程式碼,確保預設安全。

11. 在本機執行及測試代理

確認並提交安全界線後,請使用匯出的 Gemini API 金鑰在本機執行 ADK 代理程式,以便在本機遊樂場與其互動。

  1. 在終端機中,確認 Gemini API 金鑰已匯出至環境:
    echo $GEMINI_API_KEY # Verify your key is exported
    
  2. 啟動代理的本機開發測試區:
    cd ~/secure-agent-lab/shopping-assistant
    agents-cli playground
    
    您應該會看到輸出內容,指出本機遊樂區伺服器正在通訊埠 8080 上執行:
    * Serving ADK Playground
    * Running on http://127.0.0.1:8080/dev-ui/?app=app
    
  3. 在網路瀏覽器中開啟提供的網址,即可開始與購物助理代理互動。請嘗試要求兌換折扣碼:
    Can you redeem the discount code WELCOME50 for user user_123?
    
    代理程式會使用 Gemini 模型執行作業處理要求,並嘗試兌換折扣。

12. 清理

如要清理工作站,避免在本地環境中留下不必要的資源或密鑰,請按照下列步驟操作。

  1. 停止本機伺服器:如果遊樂場伺服器仍在執行中,請在終端機中按下 Ctrl + C 停止執行。
  2. 移除本機專案檔案:從電腦中刪除本機專案目錄:
    rm -rf ~/secure-agent-lab
    

13. 恭喜

恭喜!您已使用 Google Antigravity IDE 建立安全且以測試為導向的開發生命週期,並建構純 ADK 2.0 購物助理代理,且已在本機驗證。

目前所學內容

  • 如何使用 Antigravity IDE 和 agents-cli,架構及整合 ADK 2.0 代理 (ADK)。
  • 如何使用 CONTEXT.md 設定專案層級的安全程式碼標準。
  • 如何在 Antigravity IDE 中建立及執行自訂 STRIDE 威脅模型技能。
  • 如何控管 AI 代理的計畫階段,以強制執行安全界線。
  • 如何使用 pytest 實作以結果為依據的獨立安全性測試。
  • 如何在本機執行及測試代理程式應用程式。
  • Git 勾點和代理程式專屬執行勾點之間的差異和取捨。

後續步驟

贏得 Kaggle 5 天 AI 代理徽章 🎉

您是否已完成這項實驗室,並參加 Kaggle 的五天 AI 代理:Google 直覺式程式設計密集課程?領取完成徽章:

取得 5 天 AI 虛擬服務專員徽章