What checks should staff make before using AI-generated code, formulas or macros at work?

1 November 2026

What checks should staff make before using AI-generated code, formulas or macros at work?

Check the intended result, data exposure, permissions, test evidence and recovery plan before staff use AI-generated code, formulas or macros. Require competent human approval for anything affecting money, personal information or shared systems; a chatbot's explanation is not proof that it is safe.

The risk is what the output can change, not who wrote it

Staff should check the intended result, the information being shared, the actions the output can take, and the evidence that it works before using AI-generated code, formulas or macros. Anything affecting pay, customer charges, personal data or shared business systems needs approval from someone competent to assess those consequences. A convincing explanation from the chatbot is not approval.

A spreadsheet formula can quietly change a margin calculation. A macro can overwrite files. A short script can send a customer list outside your business. These are different risks, even when the same assistant produces all three. Treat them according to their effect rather than calling everything a harmless productivity experiment.

There is a useful UK example: the Home Office engineering standard on AI, updated on 20 March 2026, requires qualified human review before production, testing and traceable changes. That is a departmental standard, not a law imposing the same process on every small business. Its practical lesson is sound: AI assistance does not transfer responsibility away from the people releasing the work.

For a small firm, distinguish three situations: experimentation using invented information, internal work that people check before acting, and automation allowed to change real records. Do not let a successful experiment drift into the third category without a deliberate decision.

Check the business rule before checking the formula

Write down the result you actually need in ordinary language. Which records count? Which dates apply? Are amounts inclusive or exclusive of VAT? Should cancelled jobs be excluded? What should happen when a value is missing? If colleagues cannot agree on these rules, AI cannot settle them by producing tidy-looking code.

Consider an illustrative discount calculation: a £1,000 sale reduced by 10% should produce £900 before any separately applicable tax calculation. A formula returning £900 for that row still needs checks for a blank discount, zero-value sale, credit note and an accidentally entered percentage of 10 rather than 10%. These are test cases, not claims about a particular company's accounts or tax treatment.

Ask someone who knows the process to calculate several expected answers independently. Compare individual rows, not only the grand total: overstatements and understatements can cancel each other out. Check whether copied formulas keep the correct references and whether extra rows are included when next month's export arrives.

The Government Analysis Function's 2025 AQuA Book provides a second UK example. It distinguishes checking that analysis implements its specification from checking that it is suitable for its intended purpose. A spreadsheet can pass the first check and still answer the wrong business question. Its proportionate approach is useful here, although this government guidance is not a mandatory SME certification scheme.

Check what can leave, run or be overwritten

Before sharing an example with an AI service, remove live names, email addresses, bank details, credentials and confidential commercial information unless that use has been approved. Invented sample rows are often enough to explain the structure. Replacing a name while leaving an identifying account number is not meaningful protection.

UK data protection duties still matter when personal information enters a prompt or leaves through a generated script. A business subscription alone does not establish that your proposed use is lawful or contractually permitted. Use your approved data-handling process, and obtain specialist advice where the information or purpose requires it. Do not improvise a legal basis because a tool is convenient.

Then establish what the generated output can do. Can it read other folders, call an external service, send messages, install software, modify a database or delete records? A macro-enabled workbook deserves a different approval route from a formula that adds two cells. Never tell a colleague to disable security protections simply because generated instructions say that execution requires it.

For unfamiliar code, ask a competent reviewer to inspect dependencies, network destinations, credentials and destructive actions. Canada's Cyber Centre guidance on AI-assisted coding warns that invented package names can become a route to malicious software and that self-review by the generating model is a weak control on its own. A second chatbot may help find issues, but it is not independent proof of safety.

A sensible approval threshold for a small business

Not every formula needs a developer. Someone who understands Excel can check a simple calculation against known results. Someone approving a script that updates every customer record needs a different level of expertise. The approver must understand the possible failure, not merely be more senior than the person who asked the AI.

Proposed useMinimum sensible control
Formula in a disposable practice sheetInvented inputs and independently calculated expected answers
Formula used for quotations or management reportingProcess-owner review, checked assumptions and a saved original
Macro changing shared filesCompetent technical review, isolated test and recovery check
Code affecting payroll, permissions or customer transactionsRelevant technical and business approval before any live execution

This is a recommended decision framework, not a universal legal checklist. Your insurer, professional rules, client agreements or existing IT controls may require more. If the business cannot identify anyone capable of reviewing a proposed action, the answer is to keep that action out of production until suitable help is available.

Record the owner, approved purpose, reviewer, test results and version being approved. For a spreadsheet, a short note beside the saved workbook may be sufficient. Shared operational code needs a durable change record. If the generated output changes afterwards, assess the change rather than assuming yesterday's approval still covers it. Our answer on manager approval of employee-built AI automations explains the wider ownership question.

Test failure and recovery before trusting a successful demonstration

Use a separate copy of the workbook or a test environment with no permission to alter live records. A test database connected to real email accounts or production credentials is not properly isolated. Start with the smallest representative example and preserve an untouched original.

Include ordinary inputs and awkward ones: duplicated rows, unexpected date formats, missing fields, unusually large values and files with different column orders. Check what happens when a connection fails halfway through. Will a retry create duplicate invoices? Will the script announce success after skipping rejected records? These questions often matter more than how quickly the demonstration finishes.

Recovery must match the action. Restoring a workbook can undo local edits; it cannot recall an email already sent to a client or automatically reverse changes in an external service. Prefer preview-only or read-only operation first. For changes that cannot be fully undone, require approval before the action, not only a backup afterwards.

Keep checking after release. Name the person who will notice a wrong total or failed run, explain how to stop the workflow and leave a manual alternative. Recheck important assumptions when source data, workbook layouts, permissions or generated logic change. A reliable result last month does not validate a new export format this month.

When AI-generated code is not the right choice

Do not build a custom macro just because an assistant offers to write one. An existing Excel function, Power Query transformation, approved accounting report or supported integration may solve the problem with less maintenance. Microsoft Copilot, ChatGPT and Claude can help explain approaches, but none makes an unsuitable workflow suitable merely by generating it quickly.

AI-generated work is a poor fit when nobody can assess the result, the process has no clear owner or a mistake could cause serious harm before anyone notices. Payroll, regulated advice, safety-critical instructions and access-control changes should not become learning projects on live systems. Use an appropriate supported product or a qualified specialist.

There is a fair counterargument: requiring elaborate review for every tiny formula would erase the time saving. That is why the threshold should follow the consequence. Practising with invented data is different from calculating customer bills. Keep low-risk learning easy, and make consequential actions deliberately harder.

For a simple value check, use clearly labelled illustrative arithmetic: saving two staff hours a month at an assumed internal cost of £25 an hour creates £50 of monthly capacity before checking, support and rework. If maintaining the automation consumes three hours, it is not a saving on those assumptions. These are not quoted consultancy prices or guaranteed cash savings.

If you need help deciding whether a proposed automation deserves technical review, discuss the workflow with us. Start with what it changes, who checks it and how you recover. The right recommendation may be an ordinary spreadsheet improvement rather than a new AI system.

Is This Right For You?

This is for owners and managers deciding whether staff-generated formulas, macros or scripts are safe enough for real business work. It is not a coding tutorial or a substitute for specialist review of high-risk systems.

Frequently Asked Questions

Can staff use AI to write Excel formulas?

Yes, within your approved tool and data rules. Check the business assumptions and compare the formula against independently calculated examples before relying on it.

Does every formula need an IT specialist?

No. A competent spreadsheet user can check simple, low-impact calculations. Escalate macros, external connections, shared-system changes and financially consequential logic to an appropriately skilled reviewer.

Is asking another AI to review the output enough?

No. A second assistant can help identify issues, but it does not replace expected results, relevant human judgement or technical review where needed.

Can we paste a real customer spreadsheet into an AI tool?

Only if that tool, purpose and data use have been approved under your data protection and confidentiality arrangements. Invented sample rows are often sufficient.

What if the code runs without an error?

That proves only that it executed in those conditions. It can still calculate the wrong figures, omit records or change information it should leave alone.

Who should approve an AI-generated payroll calculation?

Someone competent to assess payroll rules and the calculation, with technical review where code or integrations are involved. Do not use live payroll as an experiment.

Do we need to retest after changing the prompt?

If the prompt produces changed code or formulas, review and retest the changed output before use. Keep the approved version and the evidence supporting it.