Build a CVE agent
Build an agent that reads the CISA Known Exploited Vulnerabilities catalog and reports the newest entries.
About this tutorial
Build an agent that keeps watch on the CISA Known Exploited Vulnerabilities (KEV) catalog, the list of vulnerabilities that are being exploited in the wild. Ask it what is new, and it fetches the catalog and reports the latest entries.
The agent needs no extra tool server. Every agent on the kagent harness has a built-in bash tool, and the runtime image includes wget. What the agent does need is permission to leave its sandbox, so you start with an egress policy for www.cisa.gov. For how egress control works, see Egress policies.
Time: about 15 minutes.
Before you begin
If kagent already runs in your cluster, skip these steps.
Create a local kind cluster. To use a Kubernetes cluster that you already run, at version 1.37 or later, skip this step.
kind create cluster --name kagent --image kindest/node:v1.37.0Set the API key of your model provider, then install the kagent CLI and run it.
kagent installsets up the CRDs, Agent Substrate, a development PostgreSQL database, and kagent, and takes a few minutes.export OPENAI_API_KEY="your-api-key-here" curl -sL https://kagent.dev/install | bash && kagent installCheck that the kagent pods run. Every pod reports
Running.kubectl get pods -n kagent
Build the CVE agent
Build the agent step by step in the kagent UI, or apply the same resources as YAML and talk to the agent with the kagent CLI.
Open the kagent UI
kagent dashboardThe command forwards the UI to http://localhost:8082 and opens it in your browser. Leave it running while you work.
Allow the agent to reach CISA

In the sidebar, click Policies, and then click Create egress policy.
In the Name field, enter
cisa-kev. Leave the Namespace askagent.Under Destination 1, in the Origin field, enter
https://www.cisa.gov. Leave Authentication set to None, because the catalog is public.Click Create policy.
Create the agent
In the sidebar, click Agents, and then click New Agent.
In the Name field, enter
cve-watch. Leave the Namespace askagent, and leave Shared harness set tokagent-default.In the Template section, select Inline, and fill in the template.
Field Value Model configuration kagent/default-model-configDescription Reports the newest known exploited vulnerabilities from CISAIn the System prompt field, enter the following prompt.
You track the CISA Known Exploited Vulnerabilities (KEV) catalog. To read the newest entries, run this command with the bash tool: wget -qO- https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json | head -n 400 The catalog lists the newest entries first. Never answer from memory. Always fetch the catalog first. For each vulnerability, report the CVE ID, the vendor and product, the date added, the due date, and whether it is used in ransomware campaigns. If the command fails, say so and show the error.The prompt gives the agent the exact command, for two reasons. The catalog is a large JSON file with the newest entries at the top, so
headkeeps the answer within what thebashtool returns. And a model that is told to always fetch does not answer from what it remembers, which is out of date for this kind of question.From the Egress policies list at the end of the form, choose
cisa-kev. Without the policy, the agent cannot reach the catalog.Click Create agent, and then click Refresh until the agent is Ready.
Ask what is new
Click the agent name,
cve-watch, to open its chat page.Ask a question, such as
What did CISA add to the catalog this week?
The conversation shows the bash tool call that fetches the catalog, and then the agent’s summary of the newest entries.
Get a daily report
To have the agent report without being asked, put it on a schedule.
- In the sidebar, click Schedules, and then click New Schedule.
- From the Agent list, choose
kagent/cve-watch, and name the schedulekev-daily. - Leave Repeat set to Daily, and in the Prompt field, enter
List the vulnerabilities that CISA added in the last seven days. - Click Create schedule.
Each run leaves its report in a conversation that you open from the schedule’s Execution history.
Verify the agent
Check that the agent is ready.
kubectl get agent cve-watch -n kagentExample output:
NAME READY AGE cve-watch True 5mCheck that kagent applied the egress policy to the agent.
kubectl get agent cve-watch -n kagent \ -o jsonpath='{range .status.conditions[?(@.type=="EgressPoliciesApplied")]}{.status} {.reason}{end}'Example output:
True AppliedCheck the agent’s answer to your question. The conversation shows a
bashcall towgetbefore the summary, and the summary lists CVE IDs with the dates that CISA added them.
What you built
An agent that fetches a public catalog through an egress policy and reports what is new. Along the way, you used these features:
| Feature | What you did | Read more |
|---|---|---|
| Egress policies | Allowed the agent to reach https://www.cisa.gov and nothing else | Egress policies |
| Built-in tools | The agent fetched the catalog with its bash tool, without a tool server | Skill tools and built-in tools |
| Scheduled runs | Optionally ran the agent every day | Scheduled runs |
Clean up
If you created the
kev-dailyschedule, delete it. In the kagent UI, click Schedules, and deletekev-daily. If you created it with grpcurl, see Scheduled runs for theDeleteScheduledRuncall.Delete the agent and the egress policy.
kubectl delete agent cve-watch -n kagent kubectl delete egresspolicy cisa-kev -n kagent