Nearly 7 million California workers who don't already have access to a retirement plan at work will soon be enrolled in a new state-run IRA savings plan.

The program, called California Secure Choice, was signed into law by Governor Jerry Brown Thursday.

It will require all businesses with at least five employees to participate if they don't already offer a pension, 401(k), or similar retirement plan for their workers. The requirement is expected to start in 2018 with businesses that have 100 or more employees, and phase in smaller businesses over the following three years.

Workers will be enrolled automatically, but will be able to opt-out at any time. If they remain in the program, 3% of their pay will be automatically contributed to the retirement account, but a worker will also be able to change how much they save.

Related: 3 steps to saving for retirement

Any contribution to the account must come from the worker. Employers will not be allowed to make an additional contribution, like some companies do for 401(k) plans.

The funds will be invested in U.S. Treasuries, or similar low-risk investments -- at least at first. The program may eventually offer other investment options.

It will be self-funded through a "small fee" paid by the workers, according to the California State Treasurer's office.

It's undecided whether the account will look more like a traditional IRA, which is tax-deferred, or a Roth IRA, which is funded through after-tax dollars.

The legislation indicates that the program will allow people to access their funds early in the case of financial hardship. Under traditional and Roth IRAs, people can withdrawal early but are hit with a penalty for doing so before age 59 ½ unless it's for a qualifying reason.

Related: 48 years old and nothing saved for retirement

"Regardless of socioeconomic status, the hard-working people of California who have made our state a global economic powerhouse deserve a measure of financial security in their golden years," said Senate President Pro Tem Kevin de León, who authored the legislation.

Connecticut, Illinois, New Jersey, Maryland, Massachusetts, Oregon and Washington have also passed legislation creating similar programs, according to Georgetown University's Center for Retirement Initiatives. None of the programs have started to operate yet. President Obama enacted a nationwide, optional retirement plan for workers, called myRA, last year.