The United States and Afghanistan have finalized an agreement that would allow U.S. troops to remain in the latter country through 2024. Secretary of State John Kerry announced the deal on Wednesday, and it now has to be approved by the Afghan government before it can take effect.

According to The New York Times, "the security agreement defines a training and counterterrorism mission in Afghanistan lasting at least 10 more years and involving 8,000 to 12,000 troops, mostly American." 

In exchange, American forces are shielded from possible Afghan prosecution while in the country, and are allowed to conduct counter-terrorism raids on private homes as well.

The agreement is intentionally vague about a number of things, leaving open a few doors. For one thing, U.S. military assistance is not required if Afghanistan is attacked. The agreement only says that the U.S. "shall regard with grave concern any external aggression." Similarly, the deal allows for an American troop presence, but does not require one. Whether or not military members will be stationed in the country for another decade is currently unclear.

Afghanistan seems to have ceded a number of demands that appeared in earlier iterations. Earlier drafts prohibited any American action, but the current one allows it if it is supplementary to Afghan operations. On Tuesday, an aide to Afghan President Hamid Karzai said that it would not accept any agreement if President Obama did not apologize for military malfeasance during the war in Afghanistan. Secretary Kerry said that the current arrangement had been reached without Obama issuing a mea culpa.

 While the estimated 10,000 members of the U.S. military expected to be stationed in the country are immune from Afghan law, private contractors—military or otherwise—are not.

The current arrangement between the two nations is only to last through the end of 2014. If the Afghan government voting body, made up of more than 3,000 members, does not approve the agreement, the country will be left without codified American assistance.