Skip to content

    Type a page, a command such as keryn scan, or a rule id.

    AI engineer shipping agents

    View as Markdown

    You get: an AI bill of materials for your agent, a map of where untrusted input can travel, and the one edge to fix first. You need: a current browser. Nothing is installed and no account is needed.

    1. Download trip-planner.zip: a FastAPI trip planner whose GPT-4o agent searches the web and books trips through tools, with a calendar MCP server in .mcp.json. Its code is shown below.
    2. Open keryn.app. Under Scan, choose File and drop the zip on the box. The scan runs in your tab.

    Open AI-BOM:

    The AI-BOM of Keryn Web for trip-planner.zip: the gpt-4o model, the calendar MCP server, the Claude Code configuration and the openai SDK, each with where it is used.The AI-BOM of Keryn Web for trip-planner.zip: the gpt-4o model, the calendar MCP server, the Claude Code configuration and the openai SDK, each with where it is used.
    The AI-BOM of trip-planner.zip: the gpt-4o model, the openai SDK, the calendar MCP server and the Claude Code configuration. Taken from keryn.app main-5g3Rr4q1.js.
    Asset Type Where
    gpt-4o model trip/agent.py:19
    openai 1.40.0 library (LLM SDK) requirements.txt:2
    calendar service (MCP server) .mcp.json:3
    Claude and Claude Code service (AI coding tool) .mcp.json

    The .mcp.json file is what a coding agent reads, so the calendar server is part of what your developers’ agents run. The badge on each row is the worst finding in the files that use it. Share and export downloads the list as a CycloneDX 1.6 AI-BOM.

    3. Where untrusted input can go (4 minutes)

    Section titled “3. Where untrusted input can go (4 minutes)”

    Go back to Decision and choose Open the trust map:

    The trust map of trip-planner.zip on the Risky paths view: the user prompt, the agent, OpenAI, the calendar MCP server and Claude Code in their zones, with fix here on the edge from the prompt to the agent and on the agent calling the calendar server.The trust map of trip-planner.zip on the Risky paths view: the user prompt, the agent, OpenAI, the calendar MCP server and Claude Code in their zones, with fix here on the edge from the prompt to the agent and on the agent calling the calendar server.
    The trust map of trip-planner.zip on the Risky paths view: the user's prompt reaches the agent, and the agent calls the calendar MCP server; both edges say fix here. Taken from keryn.app main-5g3Rr4q1.js.

    The map puts each part in a zone (the public internet, AI processing, outside services) and draws an edge wherever one can reach, call or send to another. Dashed edges are inferred from the code. Fix here marks the edge where one control would cut the riskiest path: here, the agent’s call to the calendar server, which runs through npx with no pinned version. That is also the scan’s only error.

    Show riskiest path in the repository takes you to the lines. Edit proposed model lets you correct what the scan inferred, for example mark an edge that already needs a person’s approval.

    The map reads Python, JavaScript/TypeScript, Java, Kotlin, C# and Go source, and tool declarations kept as OpenAI-style JSON (a *tools*.json file). A framework’s tools and entry points are read only when the file imports that framework. Tools: LangChain and LangGraph (including plain functions given to ToolNode, bind_tools or create_react_agent, also from another module), OpenAI Agents SDK, Vercel AI SDK, Mastra, MCP SDKs, Pydantic AI, LlamaIndex, CrewAI, smolagents, AutoGen and AG2, Google ADK, Semantic Kernel, and the OpenAI, Anthropic and Gemini tool schemas. Entry points: FastAPI, Flask, Quart, Starlette, aiohttp, Django, Streamlit, Chainlit and Gradio in Python; Next.js, Express, Hono, Fastify and Koa in JavaScript and TypeScript. In Java and Kotlin: @Tool methods of Spring AI and LangChain4j, and Spring MVC routes. In C#: Semantic Kernel [KernelFunction] methods, Microsoft.Extensions.AI AIFunctionFactory.Create tools and ASP.NET minimal-API routes. In Go: tools of the MCP Go SDKs (mark3labs/mcp-go and the official go-sdk), and net/http and gin routes. A tool or route the map does not show is not proof it is absent.

    Investigate with AI on the Decision view shows recorded example reviews until you add your own model key under Settings, Connectors. With a key, a model you choose reviews up to 60 findings; nothing is sent until you press the button, and a verdict never changes a finding’s evidence level.

    These are the files in trip-planner.zip, from the Trust Canvas journey, which models the same agent by hand.

    trip/server.py
    from fastapi import FastAPI
    from pydantic import BaseModel
    from trip.agent import plan
    app = FastAPI()
    class Chat(BaseModel):
    message: str
    @app.post("/chat")
    def chat(body: Chat) -> dict:
    return {"reply": plan(body.message)}
    trip/tools.py
    import smtplib
    import sqlite3
    import urllib.request
    from email.message import EmailMessage
    def search_pages(url: str) -> str:
    """Read a travel page the user pointed at."""
    with urllib.request.urlopen(url, timeout=10) as resp:
    return resp.read().decode("utf-8", "replace")[:20000]
    def book_trip(destination: str, traveller: str) -> int:
    """Create a booking and return its id."""
    db = sqlite3.connect("bookings.db")
    cur = db.execute("INSERT INTO bookings (destination, traveller) VALUES (?, ?)", (destination, traveller))
    db.commit()
    return cur.lastrowid
    def send_itinerary(to: str, body: str) -> None:
    """Mail the itinerary to an address."""
    msg = EmailMessage()
    msg["To"], msg["From"], msg["Subject"] = to, "trips@example.invalid", "Your itinerary"
    msg.set_content(body)
    with smtplib.SMTP("localhost") as smtp:
    smtp.send_message(msg)
    trip/agent.py
    import json
    import os
    from openai import OpenAI
    from trip import tools
    client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
    TOOLS = {"search_pages": tools.search_pages, "book_trip": tools.book_trip, "send_itinerary": tools.send_itinerary}
    def plan(message: str) -> str:
    messages = [
    {"role": "system", "content": "You plan trips. Use the tools when the traveller asks."},
    {"role": "user", "content": message},
    ]
    for _ in range(5):
    reply = client.chat.completions.create(model="gpt-4o", messages=messages, tools=[
    {"type": "function", "function": {"name": n, "parameters": {"type": "object"}}} for n in TOOLS
    ])
    choice = reply.choices[0].message
    if not choice.tool_calls:
    return choice.content
    for call in choice.tool_calls:
    result = TOOLS[call.function.name](**json.loads(call.function.arguments))
    messages.append({"role": "tool", "tool_call_id": call.id, "content": str(result)})
    return "I could not finish planning."
    .mcp.json
    {
    "mcpServers": {
    "calendar": { "command": "npx", "args": ["-y", "@example/calendar-mcp"] }
    }
    }
    fastapi==0.115.0
    openai==1.40.0

    With a pre-release build, the same scan writes the AI-BOM as CycloneDX and the findings as JSON; these commands run against the sample in this page’s tests. Exit 1 is the gate: the unpinned MCP server is an error.

    Terminal window
    keryn scan . -q --aibom aibom.cdx.json --json result.json
    Terminal window
    jq -r '.components[] | "\(.type) \(.name)"' aibom.cdx.json | sort
    jq -r '.findings[] | select(.severity == "ERROR") | "\(.ruleId) \(.path):\(.line)"' result.json
    library openai
    machine-learning-model gpt-4o
    seceng.agentcfg.mcp-npx-unpinned-package .mcp.json:3

    The CLI’s CycloneDX file lists the model and the SDK. The MCP server and the coding-agent configuration are in Keryn Web’s AI-BOM, and reach the CLI as findings like the one above; the CLI’s AI-BOM does not list them yet.