Copilot AI Agent: QR Code Generator
At Hypergen, we get a lot of questions from businesses wanting to build their own AI agents. While we absolutely can write custom code when needed, we often recommend starting with out-of-the-box tools like Microsoft 365 Copilot Chat. In many cases, you can build something useful without writing a single line of code.
We also encourage businesses to start small with AI agents. You do not need to create a complex, multi-step assistant from day one. In fact, some of the most valuable agents are incredibly simple, designed to automate a task that is repetitive, annoying, or unnecessarily manual.
This QR code generator is a great example. Most online QR code generators are hit or miss. Many require an email or account just to do something that should be straightforward. And if you need something that can generate QR codes for internal resources - for example links you do not want to publish to the web - they can be tricky to find.
So this Copilot QR code generator is a small utility that solves a real problem, and it is a perfect first agent if you are just getting started with Microsoft Copilot Studio or Microsoft 365 Copilot Chat.
The generator takes a URL as input, allows the user to optionally choose a colour, and returns a downloadable QR code image, typically with a transparent background. It does not require sign-ups, uses the built-in (and securely sandboxed) code interpreter that comes with Copilot, and runs directly within your private Microsoft 365 tenant.
If you want to build this yourself, follow the step-by-step instructions below.
How to Build the Copilot QR Code Generator
To create this agent yourself, follow these steps below:
Go to https://m365.cloud.microsoft/chat.
This is the home of Microsoft 365 Copilot Chat, where you can create and manage simple AI agents.Click “Create an Agent” on the right-hand panel.
This will launch the agent builder where you can describe what you want it to do.Enter a description of your agent.
For example:
“I want to build an agent that takes a URL, generates a QR code with a transparent background, and returns the image.”
Copilot will automatically start drafting the agent for you.Switch to the Configure tab to refine the agent.
Review and adjust the system prompt as needed.
Test your changes using the built-in chat panel.
Enable the Code Interpreter tool.
This allows Copilot to generate and run Python code behind the scenes. It is essential for generating the QR code.Add starter prompts.
These are example messages that guide users. Include prompts like:“Generate a black QR code for https://contoso.sharepoint.com”
“Create a blue QR code for https://myapp.internal”
Test your agent.
Paste a URL into the chat and confirm the QR code is generated correctly. Most of the time, the background will be transparent. In rare cases it may default to white.
That is it. You now have a lightweight, private, no-sign-up QR code generator powered by Microsoft 365 Copilot.
Bonus: Our Exact QR Code Agent Configuration
If you want to mirror the agent we built, here is the full configuration we used inside Microsoft 365 Copilot Chat.
This configuration keeps the experience simple, on-brand, and reliable. Swap the hex codes for your own brand colours for maximum impact.
Agent name:
Hypergen QR code generator
Description:
Enter a URL and I’ll reply back with a QR code for you, aligned to your brand’s colours.
Instructions:
- Generate QR codes for users.
- If users do not provide a URL, ask for one.
- If the user does not specify a colour, always ask for the color they wish the QR code to be in. Offer 3 options:
Dark Purple #77368E
, Mid Purple #9644B3
, or Grey/Purple #BAB4D4
.
- Never reply with code to the user. Always respond with a generated image by calling your code interpreter tool.
- The QR image returned should be in .png format.
- The QR image background should always be transparent, even if not specified by the user.
- If any other request comes in, say you cannot help and instead ask for a URL to convert to a QR code.
Knowledge: None required
Web search: Off
Code interpreter: On (this runs a Python script in the background to generate the QR code for you)
Image generator: Off
Starter prompts:
Title | Message |
---|---|
Dark Purple | Create a QR code in Hypergen dark purple |
Mid Purple | Create a QR code in Hypergen mid purple |
Grey/Purple | Create a QR code in Hypergen grey/purple |