Thuta Learning
AdvancedAIbeginner

Secrets, Logs, and Limits

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand secrets, logs, and limits without the intimidation
  • Get hands-on and try it yourself
  • Learn to sidestep permission issues, leaked secrets, and guesswork, no sweat

An Agent handles API keys, user notes, and tool logs. You need to keep these from leaking into prompts, git, or the UI.

Let's think about it this way for a moment

Keep secrets in an environment variable. Never put them in prompts, screenshots, or error messages. Logs are needed for debugging. But don't store full notes and keys inside them. Limits cap how many tool calls and tokens a single user, day, or question can use. If an Agent ends up in a runaway loop, this limit is the last line of defense.

Let's connect this to everyday life

Keep API_KEY in .env. Add the notes folder to .gitignore. Store only the tool name, duration, and success/fail in the log. If you need user text, keep just the first 80 characters. Rate limit example — max 5 tools per question, 40 questions per day. Write these into even a course project, and you won't forget them once you reach production.

Let's try it out together

text
env:
  API_KEY=use-environment-not-source

limits:
  max_steps_per_question: 5
  max_questions_per_day: 40

log:
  keep: tool name, duration, ok/fail
  drop: raw notes, keys, full prompts
You should see
You'll be able to set secret, log, and limit rules for an Agent project.

5-minute try-it

Write out a .gitignore list, a log fields list, and 3 limits for your project. Explain in one line each why you picked that number.

A quick word of caution

Even if a user's notes are just course material, don't share them with anyone else. Use dummy sample files for your Agent demos.

Easy traps

  • An API key showing up in an error message
  • Sharing a demo with friends with no limits in place

Now try it yourself

Write out a .gitignore list, a log fields list, and 3 limits for your project. Explain in one line each why you picked that number.

You'll know it worked when: You'll be able to set secret, log, and limit rules for an Agent project.

Secrets, Logs, and Limits | Thuta Learning