PromptisePromptise
PlatformSoonEnterprise
DocsGitHub
Talk to usGet started
Promptise - AI Framework LogoPromptise

The full-stack framework for agentic systems. Build with the framework. Run it on the platform. Launch it with our engineers.

pip install promptise

[01] Product

  • Framework
  • Platform (coming soon)
  • Enterprise
  • How it works
  • Contact

[02] Framework

  • The Agent
  • The Interface
  • The Harness

[03] Resources

  • Documentation
  • GitHub
  • Why Promptise
  • Use cases
  • Roadmap
  • Guides
  • Learning Paths
  • Questions

[04] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

hello@promptise.com
← Guides> Library> Level

Intermediate guides: from a working prototype to a reliable system

Intermediate guides are for readers who have written prompts or built a small LLM feature and now want it to work reliably. Most of the AI agent guides sit here: production MCP servers, memory and retrieval, guardrails, human approval, observability, evals, cost control and deployment, each with runnable Python.

On the prompting side they cover the mental model series, long-form writing, long-context prompting, Program-of-Thought and routing between small and large models. The security guides at this level cover prompt injection defences for agents, secure prompt design, input and output validation, monitoring and a production checklist. You should be comfortable with Python and with the basic parts of a prompt; if a term is new, a beginner guide explains it.

140
guides
140
Intermediate
37 h
of reading

Featured · start here

ReAct Agent From Scratch in Python: The Reason-Act Loop

Build a ReAct agent from scratch in Python: the Thought, Action, Observation loop, a 60-line controller with a real trace, and how it maps to tool calling.

Intermediate · 8 minRead the guide →

AI Engineering106

  1. 01Tool Parameters Array Type Must Have Items: The FixFix the tool parameters array type must have items error: why VS Code and strict providers reject MCP tool schemas, and how to fix and test them.Intermediate · 12 minTools and the Model Context Protocol (MCP)Intermediate · 12 minTools and the Model Context Protocol (MCP)→
  2. 02Who Decides When an AI Agent Is Done? Checks and JudgesWho decides when an AI agent is done? Stop conditions, self-checks, success criteria in code, a separate LLM judge and budgets as a backstop, with code.Intermediate · 16 minTesting and evalsIntermediate · 16 minTesting and evals→
  3. 03Scheduled AI Agent With Push Notifications (ntfy, Pushover)Build a scheduled AI agent with push notifications: a cron trigger, a notify tool for ntfy or Pushover, budgets, and alerts only when something changed.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  4. 04How to Revoke an AI Agent's Credentials: Incident StepsHow to revoke an AI agent's credentials: stop the agent, revoke API keys, OAuth tokens, cloud roles and MCP keys, end sessions, verify and audit.Intermediate · 18 minGuardrails and securityIntermediate · 18 minGuardrails and security→
  5. 05Microsoft Agent Framework Alternatives (2026), ComparedMicrosoft Agent Framework alternatives compared: LangGraph, OpenAI Agents SDK, Pydantic AI, Google ADK, CrewAI and Promptise, plus LangGraph in Foundry.Intermediate · 18 minFrameworks and comparisonsIntermediate · 18 minFrameworks and comparisons→
  6. 06Tool Result Too Large? Keep an AI Agent's Context SmallTool result too large for your AI agent? Page, filter and count at the tool, return errors instead of rows, and see what each design costs in tokens.Intermediate · 16 minMemory, context and RAGIntermediate · 16 minMemory, context and RAG→
  7. 07AI Agent Approval Timeouts: Fail Closed, Default DenyWhat should happen when nobody approves an AI agent's tool call? Deny on timeout, never cache consent, bind each approval to one call, escalate in time.Intermediate · 18 minHuman approvals (human-in-the-loop)Intermediate · 18 minHuman approvals (human-in-the-loop)→
  8. 08Parallel Coding Agents on One Repo: Avoid ConflictsHow to run parallel coding agents on one repo without conflicts: a git worktree per agent, scoped tasks, lockfile fixes, and merging one branch at a time.Intermediate · 17 minMulti-agent systemsIntermediate · 17 minMulti-agent systems→
  9. 09Idempotent Tool Calls: Make AI Agent Retries SafeIdempotent tool calls make AI agent retries safe: where retries come from, why timeouts duplicate actions, and how to add idempotency keys, with real code.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  10. 10Reasoning Effort for AI Agents: When High HurtsReasoning effort for AI agents: how low, medium, high and xhigh work at OpenAI, Anthropic and Google, when high effort hurts, and how to measure it.Intermediate · 15 minModels and providersIntermediate · 15 minModels and providers→
  11. 11Run Coding Agents in Dev Containers SafelyHow to run coding agents like Claude Code and Codex in a dev container safely: an egress allowlist, no sudo, read-only Git hooks, and checks that prove it.Intermediate · 18 minGuardrails and securityIntermediate · 18 minGuardrails and security→
  12. 12Vectorless RAG: Tree Search Over Long DocumentsVectorless RAG explained: how tree search over a document outline replaces vector search, when it beats embeddings and when not, with a runnable agent.Intermediate · 18 minMemory, context and RAGIntermediate · 18 minMemory, context and RAG→
  13. 13Source Provenance for Research Agents: Track Each ClaimSource provenance for research agents: tie every claim to a source the agent read and an exact quote, check it in code, and stop fake statistics.Intermediate · 16 minMemory, context and RAGIntermediate · 16 minMemory, context and RAG→
  14. 14Decision Models for AI Agents: Route, Gate and ClassifyDecision models for AI agents return probabilities, not text. Learn how they work and how to route, gate and classify with them, with runnable Python code.Intermediate · 20 minModels and providersIntermediate · 20 minModels and providers→
  15. 15LiteLLM Alternatives: LLM Gateways Compared (2026)LiteLLM alternatives in 2026: Bifrost, Portkey, Agent Router, Kong and managed LLM gateways compared, how to migrate, and when you need no gateway.Intermediate · 18 minModels and providersIntermediate · 18 minModels and providers→
  16. 16How to Test AI Agent Memory: Recall Evals in PythonHow to test AI agent memory with recall evals in Python: retrieval recall@k, then end-to-end cases for updates, dates, abstention and isolation.Intermediate · 20 minMemory, context and RAGIntermediate · 20 minMemory, context and RAG→
  17. 17Hidden Text Prompt Injection: Sanitize Pages for AI AgentsStop hidden text prompt injection: strip CSS-hidden text, comments and invisible characters from web pages, scan what is left, and limit agent tools.Intermediate · 18 minGuardrails and securityIntermediate · 18 minGuardrails and security→
  18. 18How to Review AI-Generated Code: A Practical ChecklistHow to review AI-generated code: a checklist for intent, tests, invented APIs and packages, security and dead code, plus a script for the first pass.Intermediate · 18 minTesting and evalsIntermediate · 18 minTesting and evals→
  19. 19AI Agent Tool Failures: Stop Unsafe WorkaroundsWhen a tool fails, AI agents improvise and reach the same data another way. Stop unsafe workarounds with clear errors, narrow tools and deny rules.Intermediate · 16 minTools and the Model Context Protocol (MCP)Intermediate · 16 minTools and the Model Context Protocol (MCP)→
  20. 20Per-User Agent Memory Isolation: Stop Leaks Between UsersWhy shared AI agent memory leaks between users, how per-user scopes and role-gated team notes stop it, and a canary test that proves the isolation works.Intermediate · 18 minMemory, context and RAGIntermediate · 18 minMemory, context and RAG→
  21. 21Stop Secrets Leaking Into LLM Logs and TracesHow API keys and tokens end up in LLM logs and traces, and how to redact them from tool results, observability and log lines before anything is stored.Intermediate · 18 minGuardrails and securityIntermediate · 18 minGuardrails and security→
  22. 22uv Dependency Cooldowns and Pins for Python AI AppsSet a uv dependency cooldown with exclude-newer, pin exact versions in a hashed lockfile and install only from it, so a poisoned release never reaches you.Intermediate · 8 minGuardrails and securityIntermediate · 8 minGuardrails and security→
  23. 23Jev vs Clef vs OpenAI Decisions API Compared (2026)Jev vs Clef vs OpenAI Decisions API, from each vendor's docs: prices, limits, request formats, images and self-hosting, plus how to test them on your data.Intermediate · 18 minModels and providersIntermediate · 18 minModels and providers→
  24. 24Build a Personal AI Agent: Memory, Reminders, ChatBuild a personal AI agent you host: chat over a signed webhook, memory that survives restarts, and reminders on a cron trigger, with runnable code.Intermediate · 25 minBuilding AI agents in PythonIntermediate · 25 minBuilding AI agents in Python→
  25. 25Agent Skills vs MCP Tools: When to Use EachAgent Skills vs MCP tools: what SKILL.md skills and MCP servers are, how each uses context and permissions, when to use which, and an agent using both.Intermediate · 16 minTools and the Model Context Protocol (MCP)Intermediate · 16 minTools and the Model Context Protocol (MCP)→
  26. 26Small Local Models for Tool Calling: What BreaksWhy small local models fail at tool calling: templates, parser bugs, short context, bad arguments and loops, with a fix for each and a runnable replay.Intermediate · 18 minModels and providersIntermediate · 18 minModels and providers→
  27. 27Make Your SaaS Agent-Ready: MCP, OpenAPI or BothMake your SaaS agent-ready: when to ship an MCP server, an OpenAPI spec or both, what to expose to agents, how auth works, and a runnable example.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  28. 28AI Agent Irreversible Actions: Cap Destructive Tool CallsLimit destructive actions by an AI agent: mark tools irreversible, cap them per run, add human approval, audit refusals, and know what rewind can't undo.Intermediate · 20 minRuntime, triggers and deploymentIntermediate · 20 minRuntime, triggers and deployment→
  29. 29Multi-Agent Event Bus: Chain Agents With EventsConnect AI agents with a pub/sub event bus: topics and wildcards, chaining agents on events and failures, full queues, and LangGraph and CrewAI compared.Intermediate · 20 minRuntime, triggers and deploymentIntermediate · 20 minRuntime, triggers and deployment→
  30. 30AI Agent Event Filters: Skip Runs Before the LLMFilter events before the LLM call in an AI agent: a safe expression language, Python function filters, errors caught at config time, and LLM calls saved.Intermediate · 16 minRuntime, triggers and deploymentIntermediate · 16 minRuntime, triggers and deployment→
  31. 31AI Agent Manifest: Declare a Long-Running Agent in YAMLDeclare a long-running AI agent in a YAML manifest: tools, triggers, state, journal, budgets and hooks, with strict validation and real CLI output.Intermediate · 20 minRuntime, triggers and deploymentIntermediate · 20 minRuntime, triggers and deployment→
  32. 32AI Agent Retries and a Dead Letter Queue for Failed RunsRetry failed AI agent runs with exponential backoff, catch what still fails in a dead letter queue, redeliver it, and keep tool side effects idempotent.Intermediate · 20 minRuntime, triggers and deploymentIntermediate · 20 minRuntime, triggers and deployment→
  33. 33AI Agent Escalation: Page a Human When Limits HitMake an AI agent escalate to a human when a budget, health check or mission judge trips: targets, payloads, and routing to Slack or PagerDuty via a relay.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  34. 34AI Agent CLI: Start, Stop and Inspect Running AgentsRun AI agents from the command line: start a runtime in the background, check status, follow logs, restart, stop and rewind. Real terminal output.Intermediate · 20 minRuntime, triggers and deploymentIntermediate · 20 minRuntime, triggers and deployment→
  35. 35Test Autonomous AI Agents Without Waiting for TriggersTest a scheduled or event-driven AI agent in pytest: inject ticks, script the model, freeze the clock, and assert on journal, dead letters and hooks.Intermediate · 20 minRuntime, triggers and deploymentIntermediate · 20 minRuntime, triggers and deployment→
  36. 36AI Agent Lifecycle Hooks: Run Code on Agent EventsAI agent lifecycle hooks: run code when an agent starts, queues a task, builds a prompt or is refused. Block, rewrite, shell hooks and fail-closed rules.Intermediate · 20 minRuntime, triggers and deploymentIntermediate · 20 minRuntime, triggers and deployment→
  37. 37Rewind an AI Agent: Roll Back State and ConversationRewind an AI agent to an earlier point: roll back its state and conversation from the journal, preview the plan, and compare with LangGraph time travel.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  38. 38Best AI Agent Observability Tools (2026), ComparedThe best AI agent observability tools in 2026 compared: LangSmith, Langfuse, Phoenix, Datadog and more on tool tracing, cost, evals, PII, OTel and price.Intermediate · 20 minObservability and debuggingIntermediate · 20 minObservability and debugging→
  39. 39Best Local LLM for AI Agents: Ollama Models by GPU (2026)The best local LLM for AI agents by GPU size: Ollama models that call tools well, VRAM and context needs, LM Studio and vLLM setup, and the pitfalls.Intermediate · 20 minModels and providersIntermediate · 20 minModels and providers→
  40. 40AI-Based PII Detection and Redaction Tools for LLM AppsAI-based PII detection and redaction for LLMs: regex, NER, Presidio, cloud DLP and LLM detectors compared, with code to mask prompts, tool output and logs.Intermediate · 20 minGuardrails and securityIntermediate · 20 minGuardrails and security→
  41. 41FastMCP Alternatives for Production MCP Servers (2026)FastMCP alternatives compared: the official MCP Python and TypeScript SDKs, Promptise Foundry and more, for auth, multi-tenancy, observability and deploys.Intermediate · 16 minTools and the Model Context Protocol (MCP)Intermediate · 16 minTools and the Model Context Protocol (MCP)→
  42. 42NeMo Guardrails vs Guardrails AI: Which to Choose (2026)NeMo Guardrails vs Guardrails AI compared: validators vs Colang rails, setup, model-call cost, license, the same PII check in both, and a decision table.Intermediate · 18 minGuardrails and securityIntermediate · 18 minGuardrails and security→
  43. 43LangChain Alternatives: 11 Agent Frameworks Compared (2026)Compare 11 LangChain alternatives for AI agents, from LangGraph and Pydantic AI to CrewAI: features, the same agent in four, and how to migrate.Intermediate · 20 minFrameworks and comparisonsIntermediate · 20 minFrameworks and comparisons→
  44. 44MCP Middleware for Servers: Auth, Logging, Rate LimitsMCP middleware adds auth, audit logs, rate limits, caching and timeouts to every tool call. How the pipeline and ordering work in FastMCP and Promptise.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  45. 45AutoGen Docker Task Isolation: Secure the Code ExecutorSet up AutoGen Docker task isolation: configure DockerCommandLineCodeExecutor, run one container per task, cut the network, set limits and fix errors.Intermediate · 20 minGuardrails and securityIntermediate · 20 minGuardrails and security→
  46. 46Best LLM Guardrails Tools (2026): 9 Platforms ComparedThe best LLM guardrails platforms in 2026 compared: NeMo, Guardrails AI, Azure, Bedrock, Lakera and more on injection, PII, latency, offline use and cost.Intermediate · 20 minGuardrails and securityIntermediate · 20 minGuardrails and security→
  47. 47AI Agent Health Monitoring: Catch Silent FailuresMonitor AI agent behavior in production: catch empty replies, rising error rates, stuck calls and loops, then log, pause or escalate. Real output.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  48. 48AI Agent Webhook Trigger: Run an Agent on HTTP EventsTrigger an AI agent from a webhook: HMAC signatures for GitHub and Stripe, replay protection, response codes, filters and payload injection scans.Intermediate · 20 minRuntime, triggers and deploymentIntermediate · 20 minRuntime, triggers and deployment→
  49. 49AI Agent File Watcher: Process New Files AutomaticallyRun an AI agent when files land in a folder: events, debouncing, half-written files, archiving processed files and avoiding loops. Code and real output.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  50. 50AI Agent Auto-Restart: Restart Policies and TimeoutsAuto-restart an AI agent on failure: restart policies, backoff, restart limits, run timeouts and lifetime recycling, plus an alert when it gives up.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  51. 51Run Multiple AI Agents: One Runtime, Many ProcessesRun multiple AI agents in one runtime: add and remove processes, load manifests, share notifications, contain failures and shut down cleanly on SIGTERM.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  52. 52AI Agent Secrets Management: Scoped, Expiring CredentialsManage AI agent secrets safely: scope credentials per agent, expire and rotate them, keep them out of prompts and logs, and audit each access. Real output.Intermediate · 17 minRuntime, triggers and deploymentIntermediate · 17 minRuntime, triggers and deployment→
  53. 53Pause and Resume an AI Agent: Lifecycle States ExplainedPause and resume a running AI agent: the eight lifecycle states, valid transitions, suspend and resume from code or HTTP, and what happens to queued work.Intermediate · 16 minRuntime, triggers and deploymentIntermediate · 16 minRuntime, triggers and deployment→
  54. 54Goal-Driven AI Agents: Missions With an LLM JudgeGive an AI agent a goal and let an LLM judge decide when it is done: success criteria, confidence thresholds, limits and costs. Runnable code, real output.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  55. 55Message a Running AI Agent: Inbox, Directives and AskSend instructions to a running AI agent without a restart: directives, context, corrections and questions, with TTLs, rate limits and safe scanning.Intermediate · 16 minRuntime, triggers and deploymentIntermediate · 16 minRuntime, triggers and deployment→
  56. 56AI Agent State Between Runs: Context, Keys and AuditKeep AI agent state between runs: a key-value context with writable keys and an audit trail, how it differs from memory, and how to recover it on restart.Intermediate · 17 minRuntime, triggers and deploymentIntermediate · 17 minRuntime, triggers and deployment→
  57. 57AI Agent Control API: Manage Running Agents Over HTTPManage running AI agents over HTTP: deploy, stop and restart them, patch budgets and prompts, send messages, and secure the API. Real curl calls.Intermediate · 20 minRuntime, triggers and deploymentIntermediate · 20 minRuntime, triggers and deployment→
  58. 58AI Agent Cron Jobs: Run an Agent on a ScheduleRun an AI agent on a cron schedule: time zones and DST, runs that overlap, missed ticks, idempotent jobs, and tests that don't wait. Real output.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  59. 59AI Agent Evals in CI: Run Them on Every Pull RequestRun AI agent evals in CI on every pull request: test tool choice, arguments, answers and safety, keep cost and flakiness down, with GitHub Actions.Intermediate · 18 minTesting and evalsIntermediate · 18 minTesting and evals→
  60. 60AI Agent Cost Tracking: Tokens and Cost per Run and UserTrack AI agent token usage and cost per model call, run, user and agent: price tables, cost ledgers, alerts and limits. Runnable code with real output.Intermediate · 16 minObservability and debuggingIntermediate · 16 minObservability and debugging→
  61. 61AI Agent Production Checklist: What to Check Before LaunchAn AI agent production checklist: security, approvals, guardrails, limits, cost, observability, evals, deployment and incident response, with code.Intermediate · 17 minGuardrails and securityIntermediate · 17 minGuardrails and security→
  62. 62Migrate from AutoGen: Agent Framework, AG2 and MoreAutoGen is archived. Compare migration paths (Microsoft Agent Framework, AG2, Promptise), map agents, group chats and termination, and port an example.Intermediate · 18 minMulti-agent systemsIntermediate · 18 minMulti-agent systems→
  63. 63CrewAI Alternatives: 7 Options and How to Migrate (2026)CrewAI alternatives compared: why teams look, 7 options and when each fits, a crew rebuilt in Promptise, and a map of crews, agents, tasks and flows.Intermediate · 17 minMulti-agent systemsIntermediate · 17 minMulti-agent systems→
  64. 64How to Deploy an AI Agent with Docker (2026 Guide)Deploy an AI agent with Docker: a Dockerfile, env vars and secrets, health checks, graceful shutdown, and docker compose with the agent's MCP server.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  65. 65LangGraph Alternatives: 7 Options and How to Migrate (2026)LangGraph alternatives compared: why teams look, 7 options and when each fits, the same agent in LangGraph and Promptise, and a concept map to migrate.Intermediate · 18 minFrameworks and comparisonsIntermediate · 18 minFrameworks and comparisons→
  66. 66AI Agent Prompt Injection: How to Defend Against ItHow indirect prompt injection reaches AI agents through tool results, and how to defend: untrusted-data prompts, scanners, approval gates, least privilege.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  67. 67How to Evaluate AI Agents: Evals, LLM Judges and pass^kHow to evaluate AI agents: write golden and refusal tasks, grade tool calls in code, calibrate an LLM judge, measure pass^k and gate CI on the results.Intermediate · 20 minObservability and debuggingIntermediate · 20 minObservability and debugging→
  68. 68AI Agent Stuck in a Loop? How to Detect and Stop ItWhy AI agents get stuck in loops and how to stop them: detect repeated tool calls, cap tool calls per run, and write tool results that end the loop.Intermediate · 18 minObservability and debuggingIntermediate · 18 minObservability and debugging→
  69. 69What Is an Agent Harness? Parts and How to Build OneWhat an agent harness is and how to build one: the tool loop, context compaction, token budgets, loop guards and verification, with runnable code.Intermediate · 18 minBuilding AI agents in PythonIntermediate · 18 minBuilding AI agents in Python→
  70. 70MCP vs CLI for AI Agents: Tokens, Security, When to Use EachMCP vs CLI tools for AI agents: where the tokens go, prompt caching, per-user security and when to use each or both, with runnable code and real output.Intermediate · 20 minTools and the Model Context Protocol (MCP)Intermediate · 20 minTools and the Model Context Protocol (MCP)→
  71. 71AI Agent Reasoning Patterns in Python: From ReAct to DebateHow AI agent reasoning patterns work, from ReAct to plan-and-execute, reflection, debate and code-action, and how to choose and switch them in Python.Intermediate · 15 minAgent reasoning patternsIntermediate · 15 minAgent reasoning patterns→
  72. 72Build an Authenticated MCP Server for Your AI Agent (Python)An MCP server authentication tutorial in Python: JWT login and roles, an agent that acts for each user, an attack script and a verified audit log.Intermediate · 25 minTools and the Model Context Protocol (MCP)Intermediate · 25 minTools and the Model Context Protocol (MCP)→
  73. 73Best AI Agent Frameworks (2026): Python Options ComparedThe best AI agent frameworks in 2026 by use case: LangGraph, Pydantic AI, OpenAI Agents SDK, CrewAI, Google ADK and more, with the same agent in nine.Intermediate · 24 minTools and the Model Context Protocol (MCP)Intermediate · 24 minTools and the Model Context Protocol (MCP)→
  74. 74Durable AI Agents: Crash Recovery and Safe ResumeHow to make an AI agent survive a crash: journal its progress, resume from the last step, and use idempotency keys so side effects never run twice.Intermediate · 16 minRuntime, triggers and deploymentIntermediate · 16 minRuntime, triggers and deployment→
  75. 75MCP Security Best Practices: A Checklist for MCP ServersMCP security best practices as a checklist: token audience binding, per-tool scopes, input validation, human approval, rate limits and signed audit logs.Intermediate · 20 minTools and the Model Context Protocol (MCP)Intermediate · 20 minTools and the Model Context Protocol (MCP)→
  76. 76AI Agent Cost Control: Budgets That Stop Runaway SpendHow to control AI agent costs: per-run and daily budgets that refuse tool calls before they run, token caps, iteration limits, and what each one misses.Intermediate · 18 minCost control and rate limitsIntermediate · 18 minCost control and rate limits→
  77. 77AI Agent Audit Logging: Tamper-Evident Logs in PythonLog every AI agent tool call to an HMAC-chained file, then catch edits, deletions and reordering with one command. Real tamper tests, real output.Intermediate · 15 minTools and the Model Context Protocol (MCP)Intermediate · 15 minTools and the Model Context Protocol (MCP)→
  78. 78Testing MCP Servers in Python: pytest Without a Live ServerTest an MCP server in Python without running it: auth, guards, middleware, resources, prompts, error envelopes and job queues in 35 pytest tests, plus CI.Intermediate · 16 minTools and the Model Context Protocol (MCP)Intermediate · 16 minTools and the Model Context Protocol (MCP)→
  79. 79LLM Tool Rate Limiting: Per-Client Limits for MCP ServersRate limit LLM tool calls per client, tenant and tool on a Python MCP server: a real load test, the error the agent sees, and how to retry it.Intermediate · 14 minTools and the Model Context Protocol (MCP)Intermediate · 14 minTools and the Model Context Protocol (MCP)→
  80. 80Context Engineering for AI Agents: Context Window ManagementContext engineering for AI agents: decide what the model sees on each step, return less from tools, and keep long runs small without losing the question.Intermediate · 26 minTools and the Model Context Protocol (MCP)Intermediate · 26 minTools and the Model Context Protocol (MCP)→
  81. 81Build a Production MCP Server in Python (Step by Step)Build an MCP server in Python ready for real agents: typed tools, clear errors, API keys with roles, rate limits, a tamper-evident audit log and tests.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  82. 82Streaming LLM Responses with FastAPI: Tokens and Tool CallsStream an AI agent's tool calls and answer from FastAPI to a web page with Server-Sent Events, with cancellation, errors and an EventSource page.Intermediate · 14 minBuilding AI agents in PythonIntermediate · 14 minBuilding AI agents in Python→
  83. 83MCP Transports: stdio vs Streamable HTTP vs SSE (Python)stdio vs Streamable HTTP vs SSE, shown on the wire with curl, then an MCP server over HTTP in production: Host checks, auth, health checks and scaling.Intermediate · 22 minTools and the Model Context Protocol (MCP)Intermediate · 22 minTools and the Model Context Protocol (MCP)→
  84. 84LLM Semantic Cache and Model Fallback in PythonReduce LLM API costs with a semantic cache and survive provider outages with model fallback. Real hits, tokens and a simulated outage, in Python.Intermediate · 23 minModels and providersIntermediate · 23 minModels and providers→
  85. 85AI Agent Notifications: Webhook and Slack Alerts in PythonGet alerted when your AI agent fails a tool call, hits a guardrail or budget, or needs approval. Webhooks, Slack and Python callbacks, with real payloads.Intermediate · 25 minHuman approvals (human-in-the-loop)Intermediate · 25 minHuman approvals (human-in-the-loop)→
  86. 86Deploy AI Agents in Production: Long-Running Python AgentsRun an AI agent as a long-lived Python process: cron and webhook triggers, state between runs, a journal, budgets that pause it, and honest limits.Intermediate · 15 minRuntime, triggers and deploymentIntermediate · 15 minRuntime, triggers and deployment→
  87. 87System Prompt Best Practices for AI Agents in PythonBuild agent system prompts from reusable blocks, switch them by conversation phase, and test them like code. Real Python runs, honest limits.Intermediate · 24 minBuilding AI agents in PythonIntermediate · 24 minBuilding AI agents in Python→
  88. 88AI Agent Guardrails in Python: Block Injection, Redact PIIAdd guardrails to an AI agent in Python: block prompt injection, redact PII and leaked API keys, write custom rules, and test them against real attacks.Intermediate · 19 minGuardrails and securityIntermediate · 19 minGuardrails and security→
  89. 89AI Agent Memory in Python: Short-Term and Long-TermGive your AI agent memory that lasts: chat history per session, long-term facts across sessions, kept per user. Python code with real output.Intermediate · 18 minMemory, context and RAGIntermediate · 18 minMemory, context and RAG→
  90. 90Self-Improving AI Agent: Learn From Tool Failures in PythonBuild a self-improving AI agent in Python that learns from failed tool calls without fine-tuning, and keep bad lessons, leaks and poisoned rules out.Intermediate · 22 minTools and the Model Context Protocol (MCP)Intermediate · 22 minTools and the Model Context Protocol (MCP)→
  91. 91How to Test LLM Prompts and AI Agents in PythonUnit test LLM prompts with pytest, catch prompt regressions in CI, grade outputs with an LLM judge and check which tools an AI agent calls, in Python.Intermediate · 24 minTesting and evalsIntermediate · 24 minTesting and evals→
  92. 92Build a Multi-Agent System in Python (and When Not To)Build a coordinator that delegates to specialist AI agents in Python, trace every call, and see what a multi-agent system really costs.Intermediate · 24 minTools and the Model Context Protocol (MCP)Intermediate · 24 minTools and the Model Context Protocol (MCP)→
  93. 93MCP Server Caching, Timeouts and Circuit Breakers in PythonKeep an MCP server fast when its API is flaky: caching, retries with backoff, timeouts, a circuit breaker and limits, with real before and after numbers.Intermediate · 23 minTools and the Model Context Protocol (MCP)Intermediate · 23 minTools and the Model Context Protocol (MCP)→
  94. 94Event-Driven AI Agents: Webhook, Cron and File TriggersRun an AI agent on a GitHub webhook, a cron schedule or a new file, with signed webhooks and real prompt-injection tests. Python code that runs.Intermediate · 22 minRuntime, triggers and deploymentIntermediate · 22 minRuntime, triggers and deployment→
  95. 95MCP Long-Running Tasks: Background Jobs in PythonRun slow MCP tools as background jobs in Python: submit, poll progress, retry failures and cancel, with a real agent, real runs and honest limits.Intermediate · 19 minTools and the Model Context Protocol (MCP)Intermediate · 19 minTools and the Model Context Protocol (MCP)→
  96. 96Too Many MCP Tools? How to Fix LLM Tool Selection in PythonToo many MCP tools cost tokens and lead an LLM agent to the wrong one. Learn how semantic tool selection works, how to check it offline and how to tune it.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  97. 97AI Agent Observability: Trace Tool Calls, Tokens and CostTrace every LLM call and tool call your AI agent makes, with tokens, latency and cost, then use the trace to find the exact step that went wrong.Intermediate · 18 minObservability and debuggingIntermediate · 18 minObservability and debugging→
  98. 98AI Agent YAML: Define and Run an Agent From a Config FileDefine an AI agent in a YAML file: model, instructions and MCP servers. Validate it, run it from the CLI or Python, keep secrets out, review it in Git.Intermediate · 18 minBuilding AI agents in PythonIntermediate · 18 minBuilding AI agents in Python→
  99. 99Best LLM for AI Agents (2026): Picks, Prices, How to TestThe best LLM for AI agents in 2026 by use case, from public agent benchmarks and vendor prices, why the boards disagree, and how to test models yourself.Intermediate · 20 minBuilding AI agents in PythonIntermediate · 20 minBuilding AI agents in Python→
  100. 100MCP Server Monitoring: Prometheus, OpenTelemetry and LogsMonitor an MCP server in Python: Prometheus metrics, JSON logs, OpenTelemetry traces and alerts that show which tools are slow, failing or abused.Intermediate · 20 minTools and the Model Context Protocol (MCP)Intermediate · 20 minTools and the Model Context Protocol (MCP)→
  101. 101Approval Fatigue: Auto-Approve Safe AI Agent ActionsStop rubber-stamping AI agent actions. Auto-approve routine tool calls with rules, send only risky ones to a human, and log why. Real Python runs.Intermediate · 21 minGuardrails and securityIntermediate · 21 minGuardrails and security→
  102. 102OpenAPI to MCP: Turn Any REST API into an MCP ServerTurn an OpenAPI spec into a working MCP server in minutes. Read-only by default, human approval on every write, and tested by a real agent.Intermediate · 15 minTools and the Model Context Protocol (MCP)Intermediate · 15 minTools and the Model Context Protocol (MCP)→
  103. 103AI Agent Human in the Loop: Approve Tool Calls in PythonAdd human-in-the-loop approval to an AI agent in Python: a person approves, rejects or edits each refund, email or delete before the tool runs.Intermediate · 20 minTools and the Model Context Protocol (MCP)Intermediate · 20 minTools and the Model Context Protocol (MCP)→
  104. 104Agentic RAG in Python: Give Your AI Agent a Search ToolBuild a RAG AI agent in Python: index your docs, give the agent a search tool, cite sources, and make it say "I don't know". Real code, real output.Intermediate · 21 minMemory, context and RAGIntermediate · 21 minMemory, context and RAG→
  105. 105AI Agent Code Execution Sandbox: Run LLM Code SafelyLet an AI agent write and run Python in a Docker sandbox: analyse a CSV, try real escape attempts, set limits, and learn where the sandbox stops.Intermediate · 18 minGuardrails and securityIntermediate · 18 minGuardrails and security→
  106. 106MCP Tools vs Resources vs Prompts (With Python Examples)When to use an MCP tool, resource or prompt, and how to build each in Python: resource templates, prompt arguments, tests and feeding them to an agent.Intermediate · 20 minTools and the Model Context Protocol (MCP)Intermediate · 20 minTools and the Model Context Protocol (MCP)→

Prompt Engineering20

  1. 107Can LLMs Simulate Users? Role-Play, Personas and LimitsCan LLMs simulate users or customers? The simulator view of LLMs, what research says about personas, two real role-plays that went wrong, and fixes.Intermediate · 5 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  2. 108Does AI Boost Productivity? The LLM as Cognitive MultiplierDoes AI make you more productive? What field studies show about the jagged frontier, and how to use an LLM to sharpen your judgment. Real plan example.Intermediate · 5 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  3. 109How LLMs Generate Text: Next-Token Probabilities ExplainedHow LLMs generate text one token at a time: probabilities, temperature, top-p, and why early words commit the rest. Real example of a verdict-first error.Intermediate · 5 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  4. 110Why LLM Output Is Untrusted Input: Design for InjectionWhy to treat LLM output as untrusted: indirect prompt injection, OWASP LLM risks, a real injected support ticket, and design rules that contain the damage.Intermediate · 5 minGuardrails and securityIntermediate · 5 minGuardrails and security→
  5. 111Why LLMs Mirror You: Sycophancy, Bias and Leading PromptsWhy LLMs agree with you: sycophancy from human-feedback training and bias from human text. Prompts that get honest feedback, with a real rating example.Intermediate · 5 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  6. 112How LLM Tool Calling Works: The Model Never Runs ToolsHow LLM tool calling works: the model writes a request, your code runs it. A real two-step refund exchange and design rules for tools, results and gates.Intermediate · 4 minPrompt EngineeringIntermediate · 4 minPrompt Engineering→
  7. 113Prompts as Code: The LLM as a Probabilistic CompilerTreat prompts as code: write specs, enforce output shape with structured outputs, surface assumptions and test every change. Real date-extraction example.Intermediate · 5 minTesting and evalsIntermediate · 5 minTesting and evals→
  8. 114Prompts as Interfaces: Design Prompts Like API ContractsDesign prompts like API contracts: delimited inputs, a fixed output, a defined failure path, versions and tests. A real classifier prompt before and after.Intermediate · 4 minTesting and evalsIntermediate · 4 minTesting and evals→
  9. 115LLM as a Judge vs a Jury: Making AI Evaluations ReliableLLM-as-a-judge explained: position, length and self-preference bias, and how a jury of swapped orders, rubrics and mixed models fixes it. Real example.Intermediate · 5 minTesting and evalsIntermediate · 5 minTesting and evals→
  10. 116Why LLMs Fail Modified Puzzles: Pattern-Matching BiasWhy LLMs answer the famous version of a changed puzzle: training-data priors, research on counterfactual tasks, a real failure and how to prompt around it.Intermediate · 5 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  11. 117How Context Shapes LLM Output: The Model Continues ItWhy LLMs copy the patterns in your context, flaws included: next-token prediction, Codex and multi-turn research, a real example and three fixes.Intermediate · 4 minPrompt EngineeringIntermediate · 4 minPrompt Engineering→
  12. 118Why LLMs Get Niche Facts Wrong: Popularity and Training DataWhy LLMs know popular facts but invent niche ones: accuracy tracks how often a fact appears in training data. When to retrieve instead. Real example.Intermediate · 5 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  13. 119AI Code Hallucinations: Why Plausible Output Fools YouWhy LLM code looks right but fails: plausibility vs correctness, hallucinated packages, a real regex that broke, and how to verify output by running it.Intermediate · 4 minTesting and evalsIntermediate · 4 minTesting and evals→
  14. 120Are LLMs Black Boxes? What You Can and Can't InspectAre LLMs black boxes? Why model explanations can hide the real cause, and what you can inspect instead: context, tool calls, counterfactual tests.Intermediate · 5 minObservability and debuggingIntermediate · 5 minObservability and debugging→
  15. 121LLMs as Lossy Compression: Why They Can't Quote ExactlyWhy an LLM is a lossy compression of its training data: it keeps gist and loses exact wording, quotes and URLs. What to ask it for, with a real example.Intermediate · 4 minPrompt EngineeringIntermediate · 4 minPrompt Engineering→
  16. 122Why LLMs Give Similar Answers (and How to Get Variety)Why LLMs repeat the same kind of answer: mode collapse after RLHF. Get real variety with sets, named axes and verbalized sampling. Real naming example.Intermediate · 5 minPrompt EngineeringIntermediate · 5 minPrompt Engineering→
  17. 123Long-Form LLM Writing: Control Length, Structure, StyleGenerate long-form content with an LLM: outlines with word budgets, one section per call, style rules you can check in code. Real 1,200-word example.Intermediate · 8 minPrompt EngineeringIntermediate · 8 minPrompt Engineering→
  18. 124Long-Context Prompting: Placement, Structure and RAGLong-context prompting tactics: where to put documents and the question, how to tag sources, quote-then-answer, and when to retrieve instead of stuffing.Intermediate · 8 minPrompt EngineeringIntermediate · 8 minPrompt Engineering→
  19. 125What Are PAL and Program-of-Thought Prompting?PAL and Program-of-Thought prompting explained: the model writes code, an interpreter computes the answer. How they differ, when to use them, real example.Intermediate · 7 minPrompt EngineeringIntermediate · 7 minPrompt Engineering→
  20. 126LLM Routing: When to Use a Small vs Large ModelLLM routing explained: rules, LLM routers, learned routers and cascades to send each request to the cheapest model that works. A real router misroute.Intermediate · 7 minModels and providersIntermediate · 7 minModels and providers→

LLM Security6

  1. 127LLM Output Validation: Check Responses Before You Use ThemValidate LLM output before you act on it: schema, grounding and consistency checks, safe handling of links, SQL and HTML, and when to retry or escalate.Intermediate · 10 minLLM SecurityIntermediate · 10 minLLM Security→
  2. 128LLM Supply Chain Security: Models, Packages, Data and ToolsLLM supply chain security as a checklist: inventory models, data and tools, pin and verify hashes, load safe formats, check provenance and plan fallbacks.Intermediate · 9 minTools and the Model Context Protocol (MCP)Intermediate · 9 minTools and the Model Context Protocol (MCP)→
  3. 129LLM Input Validation: Why Regex Fails and What WorksValidate LLM input in layers: limits, Unicode normalization, field rules and a scope classifier. Real examples of regex failing and what catches attacks.Intermediate · 9 minGuardrails and securityIntermediate · 9 minGuardrails and security→
  4. 130LLM Security Monitoring: Detect Attacks With Audit LogsMonitor LLM apps for attacks: what security events to log, which signals mean trouble, detection rules in Python, and alerting without alert fatigue.Intermediate · 10 minObservability and debuggingIntermediate · 10 minObservability and debugging→
  5. 131LLM Security Checklist for Production SystemsAn LLM security checklist for production: prompts and secrets, injection, RAG access, output handling, tools, dependencies, limits, monitoring, sign-off.Intermediate · 10 minLLM SecurityIntermediate · 10 minLLM Security→
  6. 132LLM Attack Surface: Vectors, Risks and the OWASP Top 10The LLM attack surface explained: user apps, integrations, APIs, data stores, insiders and supply chain, the common attack vectors, and the OWASP Top 10.Intermediate · 11 minLLM SecurityIntermediate · 11 minLLM Security→

Enterprise AI4

  1. 133AI Vendor Security Questionnaire: Keys and Supply ChainAn AI vendor security questionnaire for leaders: 24 questions on API keys, logs, releases and dependencies, why each matters and what good answers say.Intermediate · 14 minEnterprise AI agentsIntermediate · 14 minEnterprise AI agents→
  2. 134AI Agent Platform Evaluation Checklist and Scoring SheetAn AI agent platform evaluation checklist for IT and security leads: nine weighted criteria, a 1-5 scoring sheet, vendor questions and a pilot plan.Intermediate · 14 minEnterprise AI agentsIntermediate · 14 minEnterprise AI agents→
  3. 135Enterprise AI Agent Architecture: Layers and Build OrderEnterprise AI agent architecture explained: a vendor-neutral reference architecture with eight layers, a diagram, example products and a build order.Intermediate · 14 minEnterprise AI agentsIntermediate · 14 minEnterprise AI agents→
  4. 136AI Agent Governance: How to Govern AI Agents in PracticeAI agent governance in practice: owners, approvals, limits, logging, review cadence and incident steps for AI agents, with templates. Operational only.Intermediate · 13 minAI for leadersIntermediate · 13 minAI for leaders→

Prompt Security2

  1. 137Secrets in Prompts: System Prompt Leakage and Safe PatternsWhy API keys and access rules in a system prompt leak, a real extraction attempt, and patterns that keep secrets in tools, code and secret managers.Intermediate · 9 minPrompt SecurityIntermediate · 9 minPrompt Security→
  2. 138Secure Prompt Engineering: Separate Instructions From DataSecure prompt engineering: keep untrusted text as data with message roles, delimiters, spotlighting, rules and output schemas. A real before and after.Intermediate · 9 minPrompt SecurityIntermediate · 9 minPrompt Security→

LLM Systems1

  1. 139LLM Agent Orchestration Patterns: Supervisor, HandoffLLM agent orchestration patterns: single agent, chaining, routing, supervisor-workers and handoffs. When each fits and what the controller must enforce.Intermediate · 8 minMulti-agent systemsIntermediate · 8 minMulti-agent systems→

Topics at this level

  • Agent Runtime34
  • Model Context Protocol (MCP)33
  • Tool Calling23
  • Observability20
  • Evals and Testing19
  • Cost Control18
  • LLM Mental Models16
  • Guardrails15
  • Human-in-the-Loop15
  • Prompt Injection13

Other levels

  • Beginner guides75
  • Advanced guides38

Categories

  • AI Engineering147
  • Prompt Engineering54
  • AI at Work18
  • AI Leadership12
  • LLM Security10
  • Enterprise AI8

Search every guide.

The library lists all guides with filters for topic, level, category and reading time.

All guidesLearning paths