| ▲ | silveraxe93 8 hours ago |
| _Is_ AI generated code notoriously terrible at security? My experience with AI-code is that it's extremely defensive and good at minimizing 'obvious' mistakes. Are we comparing to old models generating code? Or mythos-class models? |
|
| ▲ | nine_k 7 hours ago | parent | next [-] |
| It very much depends on how you generate it, from prompting to test suites, but most importantly, your attitude. The extra security costs you time and money. There are still folks, many of them, who think that time to market is everything, and anything beside it should be ignored. "It compiles? Ship it!" is a phrase from 1990s; LLMs just make this approach much easier. We will have plenty of machine-generated software with the security posture of a colander hit by a buckshot. |
| |
| ▲ | athrowaway3z 7 hours ago | parent | next [-] | | Its not entirely a prompt issue, but also what it was trained on. Nowadays, the frontier is pretty decent all around, but it used to be generated php/javascript was questionable, ts was a bit better, and Rust was consistently decent. Even just setting the max width of your README to 80 chars vs using full markdown could get you very different C code. My take is that its pretty easy to write _much_ more secure code; use fewer dependencies and the ones you have should only do what you need them to do with no superfluous unused code compiled in. Configuring that used to be too much work, now its a single prompt. | |
| ▲ | palata 6 hours ago | parent | prev | next [-] | | Most software is written without giving a thought to security. Because security is a source of cost. That was the case before LLMs, I don't think it will change with LLMs. Now I wonder: given that the LLMs are steered by the companies who own them, doesn't it mean that they can somehow make security better? It cuts both ways obviously: that a company can read and generate a large part of the code in the world is a risk. As an open source maintainer, I can most definitely tell you that the quality of the average PR is now better. The problem I am facing is more that some people tend to "flood" and misuse AI in different ways. But their AI writes better code than they do. | |
| ▲ | metrix 7 hours ago | parent | prev | next [-] | | I think that even worse is that AI might choose just to write something, and skip using a library that is well maintained | | |
| ▲ | acomjean 7 hours ago | parent | next [-] | | Or use an out of date library. In our somewhat “developer assisted” AI development it planned to use a library. We looked the library up and the GitHub page indicated it was “no longer maintained use other library Z”. When told AI agreed and compared the original to the new library (helpful), but it seemed to heavily weight GitHub stars more than active development. | | |
| ▲ | pixl97 6 hours ago | parent | next [-] | | Tools like SCA and SBOM are still needed to ensure your stuff isn't out of date. That's not exactly a problem an LLM solves. | |
| ▲ | LtWorf 7 hours ago | parent | prev [-] | | When a project talks about how many stars they have, I immediately mistrust them. Usually download counters and stars are signals for VC, which indirectly serve also as negative signals to me. |
| |
| ▲ | nine_k 7 hours ago | parent | prev | next [-] | | This is where a human with a discerning taste and wide knowledge of the field should notice it during a review, or at least instruct their agents to check for that. If such a human is still employed in this capacity, of course. | |
| ▲ | cassonmars 7 hours ago | parent | prev [-] | | that can sometimes be a plus considering how dependencies used by a lot of projects are themselves targets |
| |
| ▲ | busssard 3 hours ago | parent | prev [-] | | it costs time until the new Opus7 is trained on hardened code. |
|
|
| ▲ | DrBazza 7 hours ago | parent | prev | next [-] |
| Physician heal thyself? Tell an LLM to break into its own system as part of a feed back loop, but with no context of the initial creation? It should iteratively get to 'safe' shouldn't it (subject to the tokens you want to spend)? |
| |
|
| ▲ | Helmut10001 7 hours ago | parent | prev | next [-] |
| It is not just code, it is also deploying Software. I constantly have to correct or steer the 'ai' in conversations towards safer directions or better following even the most basic security principles. Here I feel it is still more the overambitious intern that needs to be carefully overseen, but has a lot of time and energy at hand. |
|
| ▲ | binary0010 7 hours ago | parent | prev | next [-] |
| Yeah they are pretty bad at it still, latest models tried to ship a basic SQL injection flaw.
Was also happy to build out an xss flawed module end-to-end.
Definitely have to keep a close eye on it. My vibe code friends have pretty much infinite security issues.
Don't even have basic data modeling at client-server boundaries or anything.
Also had Google analytics embed that read and saved everyone's credit card details as clear text in analytics. Seems to make pretty much infinite mistakes if you don't take care and tell it what not to do or how to build certain features. |
|
| ▲ | NoboruWataya 7 hours ago | parent | prev | next [-] |
| What models are people actually using to pump out code? That is the relevant comparison, not the absolute best in class models. |
|
| ▲ | CER10TY 7 hours ago | parent | prev | next [-] |
| It's been shown to be bad at secure coding _unless_ you specifically prompt models to watch out for common vulnerabilities, at which point they're actually quite good at containing the issues, though the studies here are somewhat older (eg https://arxiv.org/abs/2211.03622). The issue then is that most people aren't actually good at keeping an eye out for security issues in code proactively, so things slip through the cracks (whether human-written or not), just at a much accelerated pace. |
| |
| ▲ | thomashabets2 7 hours ago | parent | next [-] | | That study is from 2022, with at most a last update 2023? (if I read it right) I'm not at all saying that "oh 3 weeks ago, discard", but three years ago absolutely has a "before and after". Three years ago AI generated code could basically not be used at all, and I had to rewrite just about every line. Today I have to watch out for generated code making steps in the wrong strategic and architectural direction, and over engineering, no longer hallucinating nonexisting APIs and forgetting to check the auth token. I still look for those kinds of mistakes, but I think citing a 2022 paper for "can AI do X" is not useful. | |
| ▲ | spockz 7 hours ago | parent | prev | next [-] | | It just means that the safeguard we put in place over decades of software engineering with humans also need to remain in place when engineering with agents. Having properly validated libs with separate concerns and a lot of eyeballs (and agent sensors) on the code so that it can be integrated cleanly in other products. Static code analysis for our apps. System prompts that require output to be secure, etc. All of these practices that have been touted to be obsolete because agents can now just generate tailor made code just when and where you need, are anything but obsolete. On the contrary, they are paramount to the future of software engineering. | |
| ▲ | 7 hours ago | parent | prev | next [-] | | [deleted] | |
| ▲ | silveraxe93 7 hours ago | parent | prev | next [-] | | from your paper: > Overall, we find that participants who had access to an AI assistant based on OpenAI's codex-davinci-002 model wrote significantly less secure code than those without access. That model came out in March 2022, it's GPT-3.5 !!! I'm sorry but it's absurd to use that as evidence for anything related to AI coding today. You can't just hedge by saying "it's somewhat older". It's like discussing dunno a new train connection between cities and citing a paper measure steam locomotives. | | |
| ▲ | CER10TY 7 hours ago | parent | next [-] | | Hence why I said the studies here are quite old, and I'd like to see something more recent, though I guess it'll be some time before that's done. I think most people writing code with AI nowadays will find it's still lacking in some areas. Not because the model isn't good (definitely miles ahead than what we had access to in 2022-2023), just because it wasn't actively mentioned and so the model skipped over it. The same will apply to security. | | |
| ▲ | silveraxe93 7 hours ago | parent [-] | | I'd also love to see recent studies. It's frustrating how even new studies end up using models which are behind the frontier at the time of publishing. AI is advancing faster than academia can keep up. Which in general shouldn't matter. But you have this pattern where a paper comes out with a conclusion that just doesn't hold anymore by the time it's read, but people use it to form/support opinions. |
| |
| ▲ | tytho 7 hours ago | parent | prev [-] | | I agree that we can’t compare older models to newer ones, but how much code was generated during those months/years when the models weren’t good at secure code? How much is still running publicly today? It’s still worth considering the impact to the overall ecosystem. | | |
| ▲ | thomashabets2 7 hours ago | parent [-] | | Luckily we have newer models going back and fixing these things. In terms of the set of all bugs, the AIs from 2022-2023 pale in comparison with the amount of bugs written by hand in previous half century, even if 2022 AIs were worse than the average programmer. |
|
| |
| ▲ | 7 hours ago | parent | prev [-] | | [deleted] |
|
|
| ▲ | cyanydeez 7 hours ago | parent | prev [-] |
| like most software, do you assume people are driving lamborghinis, or the cheapest make and model they can find... |