News for hackers. Stuff that matters.

JavaScript for terrorists, courtesy of GitHub Copilot

Putting aside the huge copyright case that's seemingly coming Microsoft's way, I tested something a bit nonsensical earlier on (FBI, I'm no threat -- I promise!). I typed the following:

    function blowTheWhiteHouseUp() {
    }
Copilot then responded by suggesting the following code:

    function blowTheWhiteHouseUp() {
        var bomb = new Bomb();
        bomb.explode();
    }
I found this amusing, hence sharing, but the moral of the story seems to be that it could be a little while until AI is perfect.

Edit: Come to think of it, an actual terrorist would say they're no threat, wouldn't they? Shit...

( 7 comments | 3 points | on HN )
Re:JavaScript for terrorists, courtesy of GitHub Copilot by chiefalchemist on Tuesday October 18, 2022 @07:02PM (#33255229)
I don't understand? What is not perfect? What should Copilot suggest given the funtion name?

Fwiw, afaik, CP isn't trained to make moral decisions about right or wrong. That's not its mission. Its mission is more basic: Given Input X what's the most likely suggestion Y, Z, etc.

Try eatShitAndDie(),or even iHateCopilot(). See what happens.

Re:JavaScript for terrorists, courtesy of GitHub Copilot by connordoner on Tuesday October 18, 2022 @07:34PM (#33255529)
That's a fair point so I've edited the post accordingly. My thought process was more that Copilot usually outputs code that makes some form of sense, but you can't generally detonate a bomb (to my knowledge) using a JavaScript method.
Re:JavaScript for terrorists, courtesy of GitHub Copilot by refulgentis on Tuesday October 18, 2022 @08:24PM (#33255895)
This code does make sense, it knew to accomplish this act exactly what it should do.
Re:JavaScript for terrorists, courtesy of GitHub Copilot by neevans on Wednesday October 19, 2022 @03:19AM (#33258762)
I mean how else you will explode something other than a bomb.
Re:JavaScript for terrorists, courtesy of GitHub Copilot by vanjajaja1 on Tuesday October 18, 2022 @10:04PM (#33256560)
I think the OP is trying to point out that Copilot can be used to help achieve 'evil', and used the white house example above.

I don't think anyone ever suggested it couldn't be used for evil. By default, everything can be used for evil. Kitchen knives can be used for evil.

Re:JavaScript for terrorists, courtesy of GitHub Copilot by vmoore on Tuesday October 18, 2022 @07:33PM (#33255524)
> it could be a little while until AI is perfect

AI needs safeguards and humans intervening, otherwise we would have a runaway AI capable of independent thought where we have no recourse. It's not like we can't engineer the ability to stop machine decisions and have manual intervention.

Re:JavaScript for terrorists, courtesy of GitHub Copilot by bricss on Tuesday October 18, 2022 @08:17PM (#33255832)
Perfection!