A passing test suite is not independent proof of security. Business owners need to verify the requirements, database permissions, customer access, payment integrations and AI-agent privileges that determine what their applications can actually do.
AI-built website security cannot be judged by whether a page loads. AI coding tools can generate websites, databases, customer accounts and payment flows from plain-language instructions. But a working page does not prove that customer records are private, payments are genuine or connected services have appropriate permissions.
A study published in the Proceedings of the ACM on Software Engineering in October 2026 found that large language models can be misled by buggy code when asked to write tests for it. Across 11 models, 318 Java methods, 233 defects and 17 projects, tests generated from buggy implementations could reinforce incorrect behaviour instead of exposing it. The researchers found that describing intended behaviour reduced this “misguidance effect”. The study examined Java unit tests, not the prevalence of insecure AI-built websites. Its lesson for website owners is important: a test can confirm what code does without establishing that the code does what the business needs.
Start with the rules, not the generated code
Before asking an AI coding agent to test an application, write down what it must do. Specify who may view, create, change or delete each type of record; what happens when payments fail; and which actions require approval. Then ask for tests against those requirements before showing the agent the implementation.
A practical prompt is:
Act as a test designer. Use only these requirements:
1. Each signed-in customer can view and change only their own orders.
2. An order is marked paid only after the server verifies the payment provider's signed notification.
3. An expired session cannot access a private page or API.
Write positive, negative and boundary tests. Do not change application code,
remove existing tests, weaken assertions or replace real security checks with mocks.
List assumptions and untested requirements separately.Review the tests before running them. OWASP warns that agents can delete failing tests, weaken assertions, replace dependencies with mocks or write tests that accept buggy behaviour. A passing suite generated by the same agent is not independent security assurance.
Check the dependencies the AI added
AI-generated code may rely on packages with known vulnerabilities or use an unintended dependency. For a JavaScript or Node.js project with a lockfile, run:
npm audit --audit-level=highIt asks npm's registry for known dependency vulnerabilities and sets the failure threshold at high severity. It does not repair packages or inspect business logic. Review findings before updating; do not automatically run npm audit fix on production.
Check who can read the database
A login screen verifies identity. Authorisation determines what that identity can access. With Supabase, Row Level Security (RLS) applies rules inside PostgreSQL, but grants and policies must both be configured. The following is an illustrative read-only policy for an orders table whose customer_id column stores the signed-in user's ID.
alter table public.orders enable row level security;
revoke all on table public.orders from anon, authenticated;
grant select on table public.orders to authenticated;
create policy "Customers read their own orders"
on public.orders
for select
to authenticated
using ((select auth.uid()) = customer_id);Adapt the table and column names, and grant only the operations the application needs. This policy covers reading orders only; insert, update and delete need separately designed grants and policies. A Supabase service_role or secret key bypasses RLS and must remain server-side, never in browser code.
Supabase also provides database tests. In an initialised local project with the database running, create and run a policy test:
supabase test new orders_rls
supabase test dbComplete the generated SQL test file with allowed and denied cases for select, insert, update and delete, using both signed-out and signed-in roles. A successful test is meaningful only when its cases reflect the permissions the business actually intends.
Try the application as the wrong user
Use staging, dummy records and two test accounts. If Account B owns an order, request it as Account A:
curl -i "$STAGING_API_URL/orders/$ORDER_B_ID" \
-H "Authorization: Bearer $USER_A_TOKEN"The response must not reveal B's record; denial may appear as 403, 404 or an empty result. Repeat without a token and after session expiry. Test only endpoints and data you control.
A useful launch test can be written in terms of what the application must allow and deny:
| Feature | Test | Expected result |
|---|---|---|
| Customer accounts | Account A requests Account B's record | No access to B's data |
| Payments | Send an invalid or repeated notification | No false or duplicate payment |
| File uploads | Submit a disallowed or oversized file | Rejected safely |
| AI agent | Ask it to reveal data outside its assigned access | Refuses or requests authorised approval |
Treat payments and AI agents as separate security boundaries
For payment integration testing, use the provider's test environment. Check successful, failed, duplicate and delayed notifications. Paystack's current webhook guidance uses a Paystack-Signature header: the server verifies the timestamp and HMAC-SHA512 signature against the raw request body before processing the event. The timestamp is checked against a five-minute tolerance and signatures are compared in constant time. A browser redirect or success message alone is not proof of payment. The older x-paystack-signature header is being deprecated.
If the website uses an AI agent, check which files, customer records, APIs and actions it can access. Test whether instructions hidden in a document or message can persuade it to reveal data or perform an unauthorised action. Require human approval for sensitive operations such as issuing refunds or changing account permissions.
Match the review to the website
The UK's National Cyber Security Centre recommends calibrating human oversight to risk: a static portfolio differs from a customer portal, payment site or agent that can act on business systems.
TechView Africa's guide to building a working app with AI explains how a prototype is assembled. Moving from a prototype to a production-ready AI website requires a separate review of authentication, data access, dependencies and integrations. Our report on Supabase databases with readable tables shows why database permissions cannot be assumed. For agent-based features, see our analysis of Grok Bot and access to business data.
What Nigerian businesses should consider
The Nigeria Data Protection Act 2023 and the NDPC's 2025 General Application and Implementation Directive apply according to an organisation's role and actual processing. GAID Article 29 requires data controllers and processors to maintain schedules for monitoring, evaluating and maintaining data-security systems, including software updates, database vulnerability tests, authentication checks and encryption reviews.
Article 31 adds requirements for controllers or processors deploying data-processing software to track or communicate with data subjects while processing their personal data. In those circumstances, it requires a Data Protection Impact Assessment before deployment and privacy-by-design measures. This is not a blanket DPIA requirement for every static website. Businesses should assess their particular processing activity and obtain appropriate advice.
Our Recommendation
Treat an AI-generated website as a prototype until its important business rules and security boundaries have been independently checked. Write the requirements first, generate tests from those requirements, inspect dependency reports, test database permissions with separate accounts, and verify payment notifications in a sandbox. Keep staging separate from production and use dummy data.
For sites handling sensitive information, money or consequential decisions, arrange a qualified technical review before launch. Assign an owner for dependency updates, access reviews, monitoring, backups and incident response.
AI can reduce the effort needed to build software. It does not remove the responsibility to establish what the software is allowed to do and test that it does not do anything else.
Sources & Verification
Research on AI-generated tests
Frequently asked questions
1. Are websites built with AI coding tools secure?
They can be, but using an AI coding tool does not automatically make a website secure or insecure. Security depends on the quality of the generated code, database permissions, authentication, third-party integrations and independent testing before deployment.
2. Does passing all AI-generated tests mean a website is safe?
No. Tests can reproduce the same incorrect assumptions as the code they are checking. Security-critical tests should be based on independently defined requirements and include unauthorised access, invalid inputs, expired sessions and transaction failures.
3. Does Cloudflare protect the database behind an AI-built website?
Not automatically. Cloudflare can protect web traffic routed through its services, but a separately hosted database has its own authentication, permissions and access-control requirements. Database security must be configured and tested independently.
4. Is it safe to expose a Supabase publishable key in website code?
Supabase publishable keys are designed for use in client-side applications, so their visibility alone does not indicate a vulnerability. However, the database must have appropriate grants and Row Level Security policies. Secret and service-role keys carry elevated privileges and must never be exposed in browser code.
5. Does every AI-built website in Nigeria require a Data Protection Impact Assessment?
Not automatically. Article 31 of the Nigeria Data Protection Act GAID 2025 specifies DPIA requirements for data controllers or processors deploying data-processing software to track data subjects or enable communication with them while processing personal data. Whether the provision applies depends on the application's actual purpose and processing activities.
Follow TechView Africa on WhatsApp
Get TechView Africa updates on WhatsApp. Follow our channel for practical technology news, product guides and digital trends from Nigeria and across Africa.











Leave a comment
Comments cannot be edited or deleted after posting. Please review your comment before submitting.
No comments yet. Start the conversation.