iq-samples / travel-agent-hosted
Copilot instructions7 starsChanged 5 months agoMITView on GitHub
This sample is part of the microsoft/iq-samples repo. Only read and modify files within this folder (travel-agent-hosted/). Do not touch other samples or root-level governance files (LICENSE, CODEOFCONDUCT.md, SECURITY.md, SUPPORT.md). This is a hosted Microsoft Foundry agent built with the Microsoft Agent Framework SDK. It is a corporate travel assistant grounded with two IQ tools: The agent's intelligence lives in the system prompt in agent/agent.py. The tool wiring (knowledge base + Work IQ Mail) is declared in agent/agent.manifest.yaml and injected…
- Reads credentials
We split this copilot-instructions.md into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
Create a Foundry IQ knowledge base from knowledge/travel-policies.json (name it to match the knowledge.id in agent/agent.manifest.yaml).
- Distinctive: line 53
Test in the Foundry hosted agent playground.
- Very specific: line 54
Run evals from evals/ against the deployed agent.
- Very specific: line 58
All secrets go in .env (gitignored) — never hardcode API keys, connection strings, or tokens.
- Very specific: line 59
Prefer az login / DefaultAzureCredential over API keys for Azure AI Search.
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions — Travel Agent (Foundry IQ + Work IQ)
Scope
This sample is part of the microsoft/iq-samples repo. Only read and modify files within this folder (travel-agent-hosted/). Do not touch other samples or root-level governance files (LICENSE, CODE_OF_CONDUCT.md, SECURITY.md, SUPPORT.md).
Project Identity
This is a hosted Microsoft Foundry agent built with the Microsoft Agent Framework SDK. It is a corporate travel assistant grounded with two IQ tools:
- Foundry IQ — a knowledge base of corporate travel policies (agentic retrieval).
- Work IQ Mail — searches the employee's email for recent policy updates, budget freezes, and temporary overrides (via OBO / on-behalf-of auth).
The agent's intelligence lives in the system prompt in agent/agent.py. The tool wiring (knowledge base + Work IQ Mail) is declared in agent/agent.manifest.yaml and injected by the Foundry hosting platform — the tools are not instantiated in code. Because Work IQ Mail requires OBO, the agent only works fully when deployed (hosted), not locally.
Tech Stack
| Component | Technology |
| Agent host | Python 3.12, Agent Framework SDK (agent-framework-*), agent-framework-foundry-hosting |
| Protocol | Responses (ResponsesHostServer) |
| Deployment | Microsoft Foundry hosted agent (agent.yaml + Dockerfile) |
| Evaluation | pytest-agent-evals against the deployed agent |
Key Files
| File | Purpose |
agent/agent.py | Agent definition + system prompt. Builds a FoundryChatClient + Agent. |
agent/main.py | Host entry point — runs ResponsesHostServer(agent). |
agent/agent.manifest.yaml | Declares the model, the Foundry IQ knowledge resource, and the WorkIQMail tool. This is where tools are wired. |
agent/agent.yaml | Container/hosting descriptor (kind: hosted, resources, env vars). |
agent/Dockerfile / agent/startup.sh | Container build + startup. |
agent/.env.template | Copy to .env and fill in your Foundry endpoint + model. |
evals/ | Evaluation suite (pytest-agent-evals) run against the deployed agent. |
evals/evaluators.py | Custom policy_completeness grader (deterministic, fact-based). |
evals/data.jsonl | Test cases with ground truth (standing policy + email override). |
knowledge/travel-policies.json | Source content for the Foundry IQ knowledge base. |
What NOT to Touch
.envfiles are gitignored. Never create or commit them. Use.env.templatefor documenting required variables.- Do not hardcode Foundry endpoints, search endpoints, tenant IDs, or API keys anywhere. Placeholders only.
- Knowledge base ↔ eval consistency:
knowledge/travel-policies.jsonandevals/evaluators.py/evals/data.jsonlare intentionally aligned (e.g. hotel cap $250/night, meal per diem $75/day). If you change a policy value in one, update the other or the evals will break.
Setup (high level — see README.md for full steps)
az login- Create a Foundry IQ knowledge base from
knowledge/travel-policies.json(name it to match theknowledge.idinagent/agent.manifest.yaml). - Configure the Work IQ Mail tool in the Foundry project (OBO connection).
cp agent/.env.template agent/.envand fill in values.- Deploy the hosted agent (
agent/agent.yaml+Dockerfile). - Test in the Foundry hosted agent playground.
- Run evals from
evals/against the deployed agent.
Security
- All secrets go in
.env(gitignored) — never hardcode API keys, connection strings, or tokens. - Prefer
az login/DefaultAzureCredentialover API keys for Azure AI Search. - Work IQ Mail uses OBO — auth is handled by the Foundry hosting layer, not in code.
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- refund-agent-a365/.github/copilot-instructions.mdCopilot instructions
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

