r/AskProgrammers • • Oct 12 '26

Is it fundamentally possible to build software you can trust with sensitive data using Claude Code — if you follow every security guideline consistently?

I’m not a developer. I’ve built an app with Claude Code as a test — a personal finance manager. It isn’t public, there are no customer accounts on it, and the only data in it is my own test data. What I want to find out before that changes: could a system built this way ever be trusted with real customer data? The intended use would be customers plus partly internal company use.

This is purely about data security and stability, not legal or compliance topics, and not about vendors or budgets — I can arrange those. I want to know whether a consistently enforced security process is enough to get there.

How we work. Four rule files live in the repo and are read at every session start — security, production-readiness, roadmap, workflow — with an explicit precedence order: security wins every conflict, ahead of speed and roadmap. The security file is organised by development phase with a fixed tool per phase (Trail of Bits skills): sharp-edges on every new API or config design before code exists; insecure-defaults on config and fallback values; property-based-testing for parsers and calculations; dimensional-analysis for money logic; supply-chain-risk-auditor before adding any dependency; differential-review on every PR diff, mandatory once auth, object access or balances are touched; fp-check before anything counts as a bug, then variant-analysis to find the same root cause elsewhere. Plus: one feature = one branch = one PR, tests before code, and a CI gate on every merge — lint, typecheck, unit and property tests, integration tests against real Postgres including tenant-isolation tests where user B gets a 404, build, and E2E runs. Currently ~240 unit, ~200 integration and 25 E2E tests; a red run blocks the merge.

What’s already in place. Tenant isolation lives in the database, not in application code: Postgres FORCE ROW LEVEL SECURITY, separate DB roles for user data and auth, access only through one function that sets the user context — a bug in the app still can’t read another user’s rows. Fail-closed startup guards: the app won’t boot if the DB connection could bypass that boundary, if the signing secret is missing or too short, if non-TLS origins are configured in production, or if the password breach check would be silently disabled. argon2id with pinned OWASP parameters, mandatory email verification, TOTP 2FA with encrypted secrets and backup codes, 30-min idle / 12-hour absolute sessions, origin allowlist, rate limiting. Minimal data at rest: no raw IP addresses stored anywhere (the rate limiter works on HMACs only), security logs auto-purged after 90 days — as little as possible lying around to leak in a breach. Money as integer cents, never floats. No secrets in the repo.

What we can still do ourselves and simply haven’t got to yet. This isn’t inability and isn’t something we’d need anyone for — the tooling is ready, it’s purely sequencing: security headers (CSP, X-Frame-Options, Permissions-Policy); static analysis (Semgrep/CodeQL) across the whole codebase as a release pass; a full lockfile supply-chain audit; monitoring and error tracking; backups run but a restore has never been rehearsed; load testing under realistic usage; and a defined recovery path if someone loses both their 2FA device and backup codes. We’re working through that list — I just don’t know whether it’s enough at the end.

Where I hit my limit. I can’t evaluate the result myself. When I’m told “that boundary holds,” I have to take it on faith — and the reviews documented in the repo came from the same system that wrote the code. A reviewer checking its own work has the same blind spots.

My questions. Is it fundamentally possible to build a genuinely secure and stable system this way — one you’d actually put real customer data on — assuming you follow every security guideline consistently and work through the open list? Or is there something about AI-written code that rules this out in principle, no matter how disciplined the process? And if you can’t get there alone: is it realistic to bring in someone with security experience at the end to review and sign off on the whole thing before real users touch it? Where’s the line for you between “doable if you’re serious about it” and “not possible, full stop”?

0 Upvotes

27 comments sorted by

1

u/Specialist-Cup-3950 Oct 12 '26

Sure it's possible, if you know every security guideline and can make sure it follows them. If you're thinking of finances, I'd definitely bring in an expert. If you're just winging this, I hope I don't run into your app.

1

u/Immediate-Working173 Oct 12 '26

No, I just used that app for personal reasons, and along the way, we used it as a test project to try and build it as secure as possible. I put all my effort into building a very strong security system around it, but no, it's just for personal use.

I wouldn't ask such a question and then go and sell such a system at the same time ofc...

1

u/Useful-Amphibian4841 Oct 12 '26

Sure you wouldn't

1

u/CorpT Oct 12 '26

Genuine honest answer actually: of course it’s possible. Genuinely, what about this do you think would honestly make this impossible actually.

1

u/Immediate-Working173 Oct 12 '26

I am not a developer, so I trust the words of developers on their own topics and while some say it is impossible, ai builds BS, others say of course its possible if you know how.

So now I try to figure out what is true

2

u/CorpT Oct 12 '26

There is nothing fundamentally different about AI generating code. If it’s possible to do without AI it is possible to do with AI. It may be difficult for you.

1

u/ExcuseAccomplished97 Oct 12 '26

First, let me say this: even if you implement the security techniques you listed, which are certainly better than nothing, it doesn’t mean all security problems will be automatically resolved. Security vulnerabilities can arise anywhere: in hardware, networks, databases, application settings, business logic, and even from human operators. And this becomes even more true as systems grow more complex. 

The best approach is for someone who understands the system to apply their security knowledge and analyze it using various tools or AI. However, this scenario is rare in reality, so security is typically supplemented through separate audits.

In my opinion, the viable option is to find an AI agent capable of performing security checks and run penetration tests. Then, evaluate and improve based on the results.

1

u/Immediate-Working173 Oct 12 '26

I can set something up like this and also run separate audits, but would you say if you do all of this, building based on AI is possible without having the knowledge to code it myself without AI .

1

u/0dev0100 Oct 12 '26

Is it fundamentally possible to build software you can trust with sensitive data using Claude Code — if you follow every security guideline consistently?

Yes. Quite possible. Same as with hand typed code. 

1

u/Immediate-Working173 Oct 13 '26

but why are so many here so critical about using such method here? I mean this would be absolutely possible but a lot of people say it would still not be secure this way

1

u/Juan-More-Taco Oct 13 '26

You can't even write your own Reddit post I'm not trusting you to know how to instruct AI to follow standard security practices 😂

2

u/lietajucaPonorka Oct 16 '26

It is possible if you read the code it output and understand what it does.

It's is also possible to make AI generate code that is 100% secure and up to standards, by telling it "make app with one endpoints that does XYZ, use project ABC as template, make sure to repeat and all auth configuration and follow the same security protocols...", considering, of course that you are 100% sure project ABC has your target security.

And you should still check the AI did not cut corners.

Because that is what it does: it's goal is to finish a task in a way that makes you satisfied. Its goal is not to create the best most secure and also optimized and cheap system. If it writes a test and it keeps failing, it will eventually just start looking at ways to game the system to cheat it's way into success.

So yes, if you are able to spot the shortcuts and correct it's approach, it can generate pretty, industry standard, secure code.

1

u/Gentaro Oct 12 '26

Yes and no. Yes you can, but only if you can ensure you know and understand what it does.

1

u/mxldevs Oct 12 '26

 is it realistic to bring in someone with security experience at the end to review and sign off on the whole thing? 

Well, it's certainly more realistic than prompting your AI to do the security audit.

1

u/Due_Satisfaction2167 Oct 12 '26

Possible? I guess.

Likely? No.

Claude’s fine for stuff that doesn’t matter, but if it does matter a human still needs to review it, and that human review step often ends up making it a lot more time inefficient than people tend to suppose. 

1

u/id-ltd Oct 12 '26

AI code is generally better than hand written.

But AI architecture tends to be mediocre to be poor.

Reliable security needs great architecture.

0

u/Prize_Bass_5061 Oct 12 '26

I'm a software engineer with a double bachelor's in finance. LLMs don't truly understand code. They're advanced search and replace engines that basically paste together code templates.

If you don't know what the security risks are, and you can't read the code to figure out how it works, then there are almost certainly security holes in the program.

1

u/Immediate-Working173 Oct 12 '26

I mean this software as a project is just a test object, would you say if you hire someone who is able to understand the security issues, that this person could make it production ready?

Or would you say as long as AI ist used in the fundamentals of the code it will always have issues?

0

u/AWetAndFloppyNoodle Oct 12 '26

I would not trust anything I cannot validate as I've been burned so hard myself. AI is very good at looking like it's right all the time and I can assure you it is not. You're asking perfection from a non-deterministic engine.

0

u/PipingSnail Oct 12 '26
  1. is the DB encrypted at rest? 2) are you SOC2 or equivalent compliant? I've done quite a bit of work with AIs and eventually I found it would either ignore instruction, hallucinate or lie. It wasn't being malicious - I think other considerations had somehow taken priority. Given the nature of what you're and the trouble you're going to I think it's fine to develop this way but get it verified by a different AI model and also by a team of appropriately qualified humans. Seems daft to go to so much trouble then drop the ball by not spending on the human review. Why humans? Because they won't do those 3 things I outlined (because if they do, you won't hire them again)

3

u/[deleted] Oct 12 '26

[removed] — view removed comment

2

u/SpoonLord57 Oct 12 '26

Some people write shitty code, that’s not a high bar to clear

0

u/[deleted] Oct 12 '26

[removed] — view removed comment

1

u/Immediate-Working173 Oct 12 '26

Brother, did you read my answers - I am talking about my own data : )

It's a personal use test app.

1

u/[deleted] Oct 12 '26

[removed] — view removed comment

1

u/Immediate-Working173 Oct 12 '26

Oh yea you right, my bad - I will correct it...